Code: Alles auswählen.
i_callback_top_of_page = 'DO_TOP_OF_PAGE'
Code: Alles auswählen.
* Text, max 60 Zeichen
wa_top_of_page-info = 'Selectionsdatum:'.
* Wenn mit Typ 'S' gearbeitet wird, ist die Ausgabe zweispaltig
* 2 Spalte befüllen (sonst nicht), max 20 Zeichen
wa_top_of_page-key = sy-datum.
Code: Alles auswählen.
* Text, max 60 Zeichen
wa_top_of_page-info = sy-datum.
* Wenn mit Typ 'S' gearbeitet wird, ist die Ausgabe zweispaltig
* 2 Spalte befüllen (sonst nicht), max 20 Zeichen
wa_top_of_page-key = 'Selectionsdatum:'.
Code: Alles auswählen.
*-----------------------------------------------------------------------
* FORM show_alv
* This subroutine prints the ALV-Grid
*-----------------------------------------------------------------------
form show_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_GRID_TITLE = 'testheader'
I_CALLBACK_TOP_OF_PAGE = 'do_top_of_page'
IT_FIELDCAT = itab_fieldcatalog
is_layout = gs_layout
TABLES
T_OUTTAB = itab2.
IF SY-SUBRC <> 0.
message s002 with text-804.
EXIT.
ENDIF.
endform.
*-----------------------------------------------------------------------
* FORM do_top_of_page
* This subroutine writes ALV-Grid header informations
*-----------------------------------------------------------------------
form do_top_of_page.
Data: it_top_of_page TYPE slis_t_listheader,
wa_top_of_page TYPE slis_listheader.
wa_top_of_page-typ = 'S'.
wa_top_of_page-info = sy-datum.
wa_top_of_page-key = 'Datum: '.
APPEND wa_top_of_page TO it_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_top_of_page.
endform.
Code: Alles auswählen.
I_CALLBACK_TOP_OF_PAGE = 'do_top_of_page'
Code: Alles auswählen.
wa_top_of_page-info = sy-datum.
Code: Alles auswählen.
DATA: h_info TYPE slis_entry.
WRITE sy-datum TO h_info.
* und dann
wa_top_of_page-info = h_info.
Code: Alles auswählen.
*-----------------------------------------------------------------------
* FORM show_alv
* This subroutine prints the ALV-Grid
*-----------------------------------------------------------------------
form show_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_GRID_TITLE = 'testheader'
I_CALLBACK_TOP_OF_PAGE = 'DO_TOP_OF_PAGE'
IT_FIELDCAT = itab_fieldcatalog
is_layout = gs_layout
TABLES
T_OUTTAB = itab2.
IF SY-SUBRC <> 0.
message s002 with text-804.
EXIT.
ENDIF.
endform.
*-----------------------------------------------------------------------
* FORM do_top_of_page
* This subroutine writes ALV-Grid header informations
*-----------------------------------------------------------------------
form DO_TOP_OF_PAGE.
Data: it_top_of_page TYPE slis_t_listheader,
wa_top_of_page TYPE slis_listheader.
wa_top_of_page-typ = 'S'.
wa_top_of_page-info = sy-datum.
wa_top_of_page-key = 'Datum: '.
APPEND wa_top_of_page TO it_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_top_of_page.
endform.
Code: Alles auswählen.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_GRID_TITLE = 'testheader'
I_CALLBACK_TOP_OF_PAGE = 'DO_TOP_OF_PAGE'
IT_FIELDCAT = itab_fieldcatalog
is_layout = gs_layout
Code: Alles auswählen.
DATA: h_repid TYPE sy-repid.
* soll laut Doku nicht direkt übergeben werden
* deswegen vorher in eine Variable schreiben
h_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = h_repid
* I_GRID_TITLE = 'testheader'
I_CALLBACK_TOP_OF_PAGE = 'DO_TOP_OF_PAGE'
IT_FIELDCAT = itab_fieldcatalog
is_layout = gs_layout