‎2008 Jun 12 6:35 PM
Hi everbody ,
At the event "BEFORE LINE OUTPUT" WITH "NEW-PAGE" I trigger the event "TOP OF PAGE".
I want to do the same but trigger the event "TOP OF LIST" how can I do that? it can be done?
‎2008 Jun 12 6:44 PM
Hi,
DATA : g_t_events TYPE slis_t_event.
DATA : g_r_events TYPE slis_alv_event.
* Top of Page event for standard header
g_r_events-name = 'TOP_OF_PAGE'.
g_r_events-form = 'TOP_OF_PAGE'.
APPEND g_r_events TO g_t_events.
NOW u call the REUSE_ALV_LIST_DISPLAY.Some thing like this
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = IT_VARIANT-REPORT
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE' IT_FIELDCAT = IT_FIELDCAT
I_SAVE = 'A'
IS_VARIANT = IT_VARIANT
TABLES
T_OUTTAB = G_T_OUTTAB
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 TOP-OF-PAGE
&---------------------------------------------------------------------
* For Top of page
----------------------------------------------------------------------
FORM TOP_OF_PAGE. "#EC CALLED
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_COMMENTARY.
ENDFORM. "top_of_page<REMOVED BY MODERATOR>
Thanks
Vikranth
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 1:45 PM
‎2008 Jun 12 7:01 PM
Hi Michael,
what is it you want to achieve?
TOP_OF_LIST is triggered automatically and once per FM call before the first line of output is created.
The only way to trigger TOP_OF_LIST is to create any output. Even if the display table is empty, it will trigger TOP_OF_LIST .
Regards,
Clemens
‎2008 Jun 12 7:06 PM
‎2008 Jun 13 10:08 AM
Hi Michael,
as I tried to explain: Just call FUNCTION 'REUSE_ALV_GRID_DISPLAY' and TOP_OF_LIST is raised (thrown).
Once again: What do you want to do?
Regards,
Clemens