Code: Alles auswählen.
DATA: feldkatalog_itab TYPE slis_t_fieldcat_alv,
wa_feldkatalog TYPE slis_fieldcat_alv,
event_itab TYPE slis_t_event,
header_itab TYPE slis_t_listheader,
gs_layout TYPE slis_layout_alv,
alv_event TYPE slis_alv_event,
wa_header TYPE slis_listheader.
Code: Alles auswählen.
*---------------------------------------------------------------------*
* FORM alv_event *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = event_itab.
IF sy-subrc EQ 0.
READ TABLE event_itab
WITH KEY name = slis_ev_top_of_page
INTO alv_event.
IF sy-subrc EQ 0.
alv_event-form = 'HEADER' .
MODIFY event_itab FROM alv_event INDEX sy-tabix.
ENDIF.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM header *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM header.
CLEAR: header_itab[].
wa_header-typ = 'H'.
wa_header-key = 'ausw1'.
wa_header-info = ' Auswertung der Dimaiobpar'.
APPEND wa_header TO header_itab.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE '
EXPORTING
it_list_commentary = header_itab.
ENDFORM.
Du machst jedoch modify:IF sy-subrc = 0.
* wenn ja dann unseren Perform setzten.
MOVE 'DO_TOP_OF_PAGE' TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
IF sy-subrc EQ 0.
alv_event-form = 'HEADER' .
MODIFY event_itab FROM alv_event INDEX sy-tabix.
ENDIF.
Code: Alles auswählen.
*---------------------------------------------------------------------*
* FORM alv_event *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = event_itab.
READ TABLE event_itab
WITH KEY name = 'TOP_OF_PAGE'
INTO alv_event.
IF sy-subrc EQ 0.
MOVE 'top_of_page' TO alv_event-form.
APPEND alv_event TO event_itab.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
* FORM alv_füllen *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM alv_fuellen .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = my_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
* i_grid_title = my_title
it_fieldcat = feldkatalog_itab
is_layout = gs_layout
it_events = event_itab
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM.
*---------------------------------------------------------------------*
* FORM header *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM top_of_page.
REFRESH header_itab[].
CLEAR wa_header.
wa_header-typ = 'H'.
* wa_header-key = 'ausw1'.
wa_header-info = text-001.
APPEND wa_header TO header_itab.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = header_itab
ENDFORM.