Skip to Content
0
Former Member
Jan 28, 2009 at 07:01 AM

Event "TOP-OF-PAGE" not getting trigerred

20 Views

Hiee friends ,

Its a simple alv list report .The top-of-page event is not getting trigerred .

Any ideas how to solve it...

REPORT  zalv_list_event.

TYPE-POOLS : slis.
TABLES : spfli.
DATA : t_spfli LIKE STANDARD TABLE OF spfli,
       fs_spfli LIKE LINE OF t_spfli.

DATA : w_carrid TYPE spfli-carrid,
       w_prog LIKE sy-repid,
       t_fieldcat TYPE slis_t_fieldcat_alv,
       fs_fieldcat TYPE slis_fieldcat_alv,
       t_eventcat TYPE slis_t_event,
       w_eventcat LIKE LINE OF t_eventcat.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_carrid FOR w_carrid.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.
  SELECT * FROM spfli INTO
           TABLE t_spfli
           WHERE carrid IN s_carrid.

END-OF-SELECTION.
  w_prog = sy-repid.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
*       I_INTERFACE_CHECK              = ' '
*       I_BYPASSING_BUFFER             =
*       I_BUFFER_ACTIVE                = ' '
       i_callback_program             = w_prog
*       I_CALLBACK_PF_STATUS_SET       = ' '
*       i_callback_user_command        =
       i_structure_name               = 'SPFLI'
*       IS_LAYOUT                      =
*       IT_FIELDCAT                    =
*       IT_EXCLUDING                   =
*       IT_SPECIAL_GROUPS              =
*       IT_SORT                        =
*       IT_FILTER                      =
*       IS_SEL_HIDE                    =
*       I_DEFAULT                      = 'X'
*       I_SAVE                         = ' '
*       IS_VARIANT                     =
         it_events                      = t_eventcat
*       IT_EVENT_EXIT                  =
*       IS_PRINT                       =
*       IS_REPREP_ID                   =
*       I_SCREEN_START_COLUMN          = 0
*       I_SCREEN_START_LINE            = 0
*       I_SCREEN_END_COLUMN            = 0
*       I_SCREEN_END_LINE              = 0
*       IR_SALV_LIST_ADAPTER           =
*       IT_EXCEPT_QINFO                =
*       I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
*     IMPORTING
*       E_EXIT_CAUSED_BY_CALLER        =
*       ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = t_spfli
     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  t_eventcat
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM t_eventcat .
  w_eventcat-name = 'TOP-OF-PAGE'.
  w_eventcat-form = 'TOP'.
  APPEND w_eventcat TO t_eventcat.
ENDFORM.                    "T_EVENTCAT

*&---------------------------------------------------------------------*
*&      Form  TOP
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM top.
*  READ TABLE t_spfli INTO fs_spfli INDEX 1.
*  WRITE:/ 'CARRIER ID:'(001),30 fs_spfli-carrid,
*        / 'CONNECTION NUMBER :'(002), 30 fs_spfli-connid.

  WRITE :/ 'ALV Report with TOP-OF-PAGE'.
ENDFORM.                    "TOP