Google Search - Blog...........

ABAP - ALV In HTML Format.

REPORT ztest_page.


DATA : it_flight TYPE TABLE OF sflight WITH HEADER LINE.
data: t type x.

START-OF-SELECTION.


SELECT * FROM sflight INTO TABLE it_flight.

END-OF-SELECTION.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_structure_name = 'SFLIGHT'
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1
OTHERS = 2.

*&---------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM top_of_page.

WRITE 'This is the Top of page which triggers in print'.

ENDFORM. "TOP_OF_PAGE
*&---------------------------------------------------------------------*
*& Form html_top_of_page
*&---------------------------------------------------------------------*

FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA : dl_text(255) TYPE c. "Text
* Add new-line
CALL METHOD document->new_line.

CALL METHOD document->new_line.

CLEAR : dl_text.
* program ID
dl_text = 'Program Name :'.
CALL METHOD document->add_gap.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_heading_int.

CLEAR dl_text.
dl_text = sy-repid.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.

* Add new-line
CALL METHOD document->new_line.
CLEAR : dl_text.

dl_text = sy-uname.
CALL METHOD document->add_gap
EXPORTING
width = 34.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.

* Add new-line
CALL METHOD document->new_line.
CLEAR : dl_text.

CALL METHOD document->add_gap
EXPORTING
width = 34.
* Move date
WRITE sy-datum TO dl_text.

CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.

* Add new-line
CALL METHOD document->new_line.
CLEAR : dl_text.
* Move time
WRITE sy-uzeit TO dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 34.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_color = cl_dd_area=>list_negative_inv.

* Add new-line
CALL METHOD document->new_line.

ENDFORM. "HTML_TOP_OF_PAGE



No comments:

Post a Comment