Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

html

Former Member
0 Kudos

How to use html top of page in alv grid display?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai,

See the below code:

gs_layout_alv-colwidth_optimize = 'X'.

gs_layout_alv-zebra = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gv_repid

i_callback_top_of_page = 'TOP_OF_PAGE'

i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'

is_layout = gs_layout_alv

it_fieldcat = gt_fieldcat

TABLES

t_outtab = gt_rep_data

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

FORM html_top_of_page USING document

TYPE REF TO cl_dd_document.

DATA: lv_text TYPE sdydo_text_element.

lv_text = sy-title.

CALL METHOD document->add_text

EXPORTING

text = lv_text

sap_style = 'HEADING'.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

WRITE sy-datum TO lv_text.

WRITE sy-uzeit TO lv_text+12.

WRITE sy-uname TO lv_text+24.

CALL METHOD document->add_text

EXPORTING text = lv_text

sap_style = 'NORMAL'.

ENDFORM. "html_top_of_page

FORM top_of_page.

CALL FUNCTION 'ZREPORT_HEADER'

EXPORTING

rept_title = sy-title.

ENDFORM. "TOP_OF_PAGE

1 REPLY 1

Former Member
0 Kudos

Hai,

See the below code:

gs_layout_alv-colwidth_optimize = 'X'.

gs_layout_alv-zebra = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gv_repid

i_callback_top_of_page = 'TOP_OF_PAGE'

i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'

is_layout = gs_layout_alv

it_fieldcat = gt_fieldcat

TABLES

t_outtab = gt_rep_data

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

FORM html_top_of_page USING document

TYPE REF TO cl_dd_document.

DATA: lv_text TYPE sdydo_text_element.

lv_text = sy-title.

CALL METHOD document->add_text

EXPORTING

text = lv_text

sap_style = 'HEADING'.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

WRITE sy-datum TO lv_text.

WRITE sy-uzeit TO lv_text+12.

WRITE sy-uname TO lv_text+24.

CALL METHOD document->add_text

EXPORTING text = lv_text

sap_style = 'NORMAL'.

ENDFORM. "html_top_of_page

FORM top_of_page.

CALL FUNCTION 'ZREPORT_HEADER'

EXPORTING

rept_title = sy-title.

ENDFORM. "TOP_OF_PAGE