EVENTS in Classical ALV

Hi,
I want to know the Purpose of using the below Events in Classical ALV (if possible with example).
1. CALLER_EXIT
2. REPREP_SEL_MODIFY
3. top_of_coverpage
4. END_OF_COVERPAGE
5. TOP_OF_FOREIGN_PAGE
6. END_OF_FOREIGN_PAGE
7.SUBTOTAL_TEXT
Thanks in Advance,
Sumi

The I_EVENTS table returns with the following possible constants:
1.     Slis_ev_item_data_expand TYPE slis_formname VALUE 'ITEM_DATA_EXPAND'.     
Only relevant for hierarchical-sequential lists using the layout parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT. Exit for passing item entries (ITEM table) for a header record that was expanded interactively by the user.
2.     Slis_ev_reprep_sel_modify TYPE slis_formname VALUE 'REPREP_SEL_MODIFY'.
RS_SELFIELD-TABINDEX contains the header table index for which the item entries are to       be put in the global item output table (T_OUTTAB_SLAVE). The Callback is only called if ALV has no items for a header that is to be expanded.
RFLG_ALL is passed with 'X' if the user shows all items. The application must ensure that    entries are not repeated in the item table.
    RS_SELFIELD is initial in this case.         
3.     Slis_ev_caller_exit_at_start TYPE slis_formname VALUE 'CALLER_EXIT'.
Is called at the beginning of the function module to make special settings. It is not usually used.          
4.     Slis_ev_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
As this is a frequently-used Callback event, the form routine can also be passed        directly in the interface by passing the user command in the IMPORTING parameter           I_CALLBACK_USER_COMMAND.
5.     Slis_ev_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
   Equivalent to the list processing TOP-OF-PAGE event.           
6.     Slis_ev_top_of_coverpage TYPE slis_formname VALUE 'TOP_OF_COVERPAGE'.       
The selection information and list status are output together (if they exist) on a separate page by default
7.     Slis_ev_end_of_coverpage TYPE slis_formname VALUE 'END_OF_COVERPAGE'.       
Analogously to TOP_OF_COVERPAGE the user can add other information
to the information output by ALV (selection information, list status) at this event.
8.     Slis_ev_foreign_top_of_page TYPE slis_formname VALUE ‘FOREIGN_TOP_OF_PAGE'.
The Top-of-page event is always processed in ALV and is only passed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a user action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV).
In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called.
9.     Slis_ev_foreign_end_of_page TYPE slis_formname VALUE 'FOREIGN_END_OF_PAGE'.  
The event end-of-page is always processed in ALV and only passed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV).
In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called.                             
10.     Slis_ev_pf_status_set TYPE slis_formname VALUE 'PF_STATUS_SET'.
If a user list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS command (with inactive user function codes as well, if necessary).
The STANDARD status of the function group SALV should be used as a          template for a user-specific status. As this is a frequently used Callback event, its form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET.
11.     Slis_ev_list_modify TYPE slis_formname VALUE 'LIST_MODIFY'.     
LIST_MODIFY USING R_TABNAME TYPE SLIS_TABNAME
                                         R_INDEX LIKE SY-TABIX
                                         R_INDEX_ITEM LIKE SY-TABIX
                                         R_INDEX_SUM LIKE SY-TABIX.
12.     Slis_ev_top_of_list TYPE slis_formname VALUE 'TOP_OF_LIST'.  
Information output at the start of the list     
13.     Slis_ev_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
Information output at the end of a page. This is only called for printing.
14.     Slis_ev_end_of_list TYPE slis_formname VALUE 'END_OF_LIST'.     
Information output at the end of the list
15.     Slis_ev_after_line_output TYPE slis_formname VALUE 'AFTER_LINE_OUTPUT'.
Output information after each output line. Should only be used in justified cases because it costs a lot of performance.
16.     Slis_ev_before_line_output TYPE slis_formname VALUE   'BEFORE_LINE_OUTPUT'.       
Output information before each output line. Should only be used in justified cases because it costs a lot of performance.         
17.     Slis_ev_subtotal_text TYPE slis_formname VALUE  'SUBTOTAL_TEXT'.                        
This event table (I_EVENTS) is now checked with the desired constants. If the desired constant is found, then the corresponding field for the FORM NAME is populated with the name of the routine containing the corresponding event.

Similar Messages

  • Regarding Reading contents in classical ALV

    Hi Experts,
    I have a problem in Classical ALV Grid Display.
    I donot know how to read the contents of  modified fields after the grid is displayed.ie. i will modify some cells and press a button which is defined by me then the modified contents need to be read and updated in the data base.i am not able to read those modified contents.so please help me.i am using REUSE_ALV_GRID_DISPLAY.that is my requirement.i cannot use ALV Objects.i am posting the code.please verify and help me.
    REPORT  ZMRMMO_CUSTPOCHANGE.
    *******************************TABLES***************************************
    TABLES : VBAK,   "Sales Document:Header Data.
             VBUK,   "Sales Document:Header Status And Administrative Data.
             VBAP.   "Sales Document:Item Data.
    ********************************TYPES***************************************
    INCLUDE ZPOCHANGE_DECLARATIONS.   "Include Program for declaration part.
    ****************************SELECTION SCREEN********************************
    INCLUDE ZPOCHANGE_SELSCREEN.      "Include Program for selection screen.
    ****************************INITIALIZATION**********************************
    INITIALIZATION.
    COM1 = 'Select Reject Open Sale Order Radio Button To Delete An Open Sale Order'.
    COM2 = 'Select Remove Rejection Radio Button To Undo The Delete sale Order'.
    ****************************START OF SELECTION******************************
    START-OF-SELECTION.
    *CREATE OBJECT obj1.
    PERFORM F_CUSTPOSELECTION. "Subroutine for selection of data from the tables.
    PERFORM F_BUILDFCAT.      "Subroutine To bulid a field catalog.
    *I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    *I_LAYOUT-BOX_TABNAME = 'I_FINAL'.
    *I_LAYOUT-BOX_FIELDNAME = 'X'.
    *APPEND I_LAYOUT.
    PERFORM F_EVENTSGET.
    IF FLAG = 'X'.
    PERFORM F_ALVGRIDDISPLAY. "Subroutine to call the ALV Grid Display Function Module inorder to display the data
    ELSE.
    EXIT.
    ENDIF.
    FORM F_POCHANGEPFSTATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'PO_CHANGE'. "EXCLUDING RT_EXTAB.
    ENDFORM.
    FORM F_POCHNGUSERCOMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
    RS_SELFIELD-REFRESH = 'X'.
    IF R_UCOMM EQ 'UPD'.
    PERFORM F_POCHANGECHECK." USING RS_SELFIELD.
    ENDIF.
    ENDFORM.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_POPULF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_TESTF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01.
    *&  Include           ZPOCHANGE_DECLARATIONS
    TYPE-POOLS : SLIS.
    TYPES :BEGIN OF TY_VBAK,
           VBELN LIKE VBAK-VBELN,
           BSTNK LIKE VBAK-BSTNK,
           KUNNR LIKE VBAK-KUNNR,
           LIFSK LIKE VBAK-LIFSK,
           GWLDT LIKE VBAK-GWLDT,
           END OF TY_VBAK,
           BEGIN OF TY_VBUK,
           VBELN LIKE VBUK-VBELN,
           LFGSK LIKE VBUK-LFGSK,
           END OF TY_VBUK,
           BEGIN OF TY_VBAP,
           VBELN LIKE VBAP-VBELN,
           LPRIO LIKE VBAP-LPRIO,
           ABGRU LIKE VBAP-ABGRU,
           END OF TY_VBAP,
           BEGIN OF TY_FINAL,
           VBELN LIKE VBAK-VBELN,
           BSTNK LIKE VBAK-BSTNK,
           KUNNR LIKE VBAK-KUNNR,
           LFGSK LIKE VBUK-LFGSK,
           LIFSK LIKE VBAK-LIFSK,
           GWLDT LIKE VBAK-GWLDT,
           LPRIO LIKE VBAP-LPRIO,
           ABGRU LIKE VBAP-ABGRU,
           END OF TY_FINAL.
    ****************************INTERNAL TABLES*********************************
    DATA :I_VBAK TYPE STANDARD TABLE OF TY_VBAK,
          I_VBUK TYPE STANDARD TABLE OF TY_VBUK,
          I_VBAP TYPE STANDARD TABLE OF TY_VBAP,
          I_FINAL TYPE STANDARD TABLE OF TY_FINAL,
          WA_VBAK TYPE TY_VBAK,
          WA_VBUK TYPE TY_VBUK,
          WA_VBAP TYPE TY_VBAP,
          WA_FINAL TYPE TY_FINAL.
    DATA : I_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           I_LAYOUT TYPE SLIS_LAYOUT_ALV, "OCCURS 0,
           WA_FCAT LIKE LINE OF I_FCAT,
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
           I_EVENTS TYPE SLIS_T_EVENT,
           WA_EVENTS LIKE LINE OF I_EVENTS,
           I_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
           WA_FCAT1 LIKE LINE OF I_FCAT1.
    *DATA : obj1 TYPE REF TO CL_GUI_ALV_GRID_BASE.
    *DATA :G_ROWNO TYPE I.
    DATA FLAG VALUE 'X'.
    *&  Include           ZPOCHANGE_SELSCREEN
    ****************************SELECTION SCREEN********************************
    SELECTION-SCREEN : BEGIN OF BLOCK SC1 WITH FRAME TITLE TEXT-000.
    PARAMETERS : P_KUNNR TYPE VBAK-KUNNR OBLIGATORY,
                 P_BSTNK TYPE VBAK-BSTNK.
    SELECTION-SCREEN : END OF BLOCK SC1.
    SELECTION-SCREEN : BEGIN OF BLOCK SC2 WITH FRAME TITLE TEXT-001.
    PARAMETERS : R_REMSET RADIOBUTTON GROUP RAD1,
                 R_CNGGAR RADIOBUTTON GROUP RAD1,
                 R_CNGDEL RADIOBUTTON GROUP RAD1,
                 R_REJSO RADIOBUTTON GROUP RAD1,
                 R_REMREJ RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN : COMMENT /1(79) COM1,
                       COMMENT /1(79) COM2.
    SELECTION-SCREEN : END OF BLOCK SC2.
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01 .
    *&      Form  F_CUSTPOSELECTION
          text
    -->  p1        text
    <--  p2        text
    FORM F_CUSTPOSELECTION .
    IF P_BSTNK IS INITIAL.
      SELECT VBELN BSTNK KUNNR LIFSK GWLDT
             FROM VBAK
             INTO TABLE I_VBAK
             WHERE KUNNR EQ P_KUNNR.
      IF SY-SUBRC <> 0.
        MESSAGE I000(YMES).
        FLAG = '0'.
      ELSE.
        SORT I_VBAK BY VBELN.
      ENDIF.
    ELSE.
      SELECT VBELN BSTNK KUNNR LIFSK GWLDT
             FROM VBAK
             INTO TABLE I_VBAK
             WHERE KUNNR EQ P_KUNNR AND
                   BSTNK EQ P_BSTNK.
      IF SY-SUBRC <> 0.
        MESSAGE I000(YMES).
        FLAG = '0'.
        ELSE.
        SORT I_VBAK BY VBELN.
      ENDIF.
    ENDIF.
    *IF I_VBAK[] IS NOT INITIAL.
    LOOP AT I_VBAK INTO WA_VBAK.
       WRITE :/    WA_VBAK-VBELN,
             10  WA_VBAK-BSTNK,
             20  WA_VBAK-KUNNR,
             30  WA_VBAK-LIFSK,
             40  WA_VBAK-GWLDT.
    ENDLOOP.
    *ENDIF.
    IF I_VBAK[] IS NOT INITIAL.
      SELECT VBELN LFGSK
             FROM VBUK
             INTO TABLE I_VBUK
             FOR ALL ENTRIES IN I_VBAK
             WHERE VBELN = I_VBAK-VBELN AND
                   LFGSK <> 'C'.
    ENDIF.
    IF SY-SUBRC <> 0.
      MESSAGE I000(YMES).
      FLAG = '0'.
    ELSE.
      SORT I_VBUK BY VBELN.
    ENDIF.
    *IF I_VBUK[] IS NOT INITIAL.
    LOOP AT I_VBUK INTO Wa_VBUK.
       WRITE :/ WA_VBUK-VBELN,
             10 WA_VBUK-LFGSK.
    ENDLOOP.
    *ENDIF.
    IF I_VBUK IS NOT INITIAL.
      SELECT VBELN LPRIO ABGRU
             FROM VBAP
             INTO TABLE I_VBAP
             FOR ALL ENTRIES IN I_VBUK
             WHERE VBELN = I_VBUK-VBELN.
    ENDIF.
    IF SY-SUBRC <> 0.
      MESSAGE I000(YMES).
    FLAG = '0'.
    ELSE.
      SORT I_VBAP BY VBELN.
    ENDIF.
    LOOP AT I_VBUK INTO WA_VBUK.
    MOVE :WA_VBUK-VBELN TO WA_FINAL-VBELN,
          WA_VBUK-LFGSK TO WA_FINAL-LFGSK.
    READ TABLE I_VBAK INTO WA_VBAK WITH KEY WA_VBUK-VBELN.
    MOVE :WA_VBAK-BSTNK TO WA_FINAL-BSTNK,
          WA_VBAK-KUNNR TO WA_FINAL-KUNNR,
          WA_VBAK-LIFSK TO WA_FINAL-LIFSK,
          WA_VBAK-GWLDT TO WA_FINAL-GWLDT.
    READ TABLE I_VBAP INTO WA_VBAP WITH KEY WA_VBUK-VBELN.
    MOVE :WA_VBAP-LPRIO TO WA_FINAL-LPRIO,
          WA_VBAP-ABGRU TO WA_FINAL-ABGRU.
    APPEND WA_FINAL TO I_FINAL.
    CLEAR WA_FINAL.
    ENDLOOP.
    ENDFORM.                    " F_CUSTPOSELECTION
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01 .
    *&      Form  F_BUILDFCAT
          text
    -->  p1        text
    <--  p2        text
    FORM F_BUILDFCAT .
    PERFORM F_POPULATE_FCAT USING '1' 'VBELN' 'I_FINAL' '' '' '10' 'Sales Document' 'VBELN' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '2' 'BSTNK' 'I_FINAL' '' '' '10' 'Customer PO No.' 'BSTNK' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '3' 'KUNNR' 'I_FINAL' '' 'X' '10' 'Sold-to Party' 'KUNNR' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '4' 'LFGSK' 'I_FINAL' '' '' '1' 'Delivery Status' 'LFGSK' 'VBUK'.
    CASE 'X'.
    WHEN R_REMSET.
    PERFORM F_POPULATE_FCAT USING '5' 'LIFSK' 'I_FINAL' '' '' '2' 'Delivery BlocK' 'LIFSK' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '6' 'LIFSK' 'I_FINAL' 'X' '' '2' 'Present Delivery BlocK' 'LIFSK' 'VBAK'.
    WHEN R_CNGGAR.
    PERFORM F_POPULATE_FCAT USING '5' 'GWLDT' 'I_FINAL' '' '' '8' 'Guarantee Date' 'GWLDT' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '6' 'GWLDT' 'I_FINAL' 'X' '' '8' 'Present Guarantee Date' 'GWLDT' 'VBAK'.
    WHEN R_CNGDEL.
    PERFORM F_POPULATE_FCAT USING '5' 'LPRIO' 'I_FINAL' '' '' '2' 'Delivery Priority' 'LPRIO' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'LPRIO' 'I_FINAL' 'X' '' '2' 'Present Delivery Priority' 'LPRIO' 'VBAP'.
    WHEN R_REJSO.
    PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    WHEN R_REMREJ.
    PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    ENDCASE.
    ENDFORM.                    " F_BUILDFCAT
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01 .
    *&      Form  F_EVENTSGET
          text
    -->  p1        text
    <--  p2        text
    FORM F_EVENTSGET .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = I_EVENTS
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    IF SY-SUBRC <> 0.
    SORT I_EVENTS BY NAME.
    ENDIF.
    *READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'USER_COMMAND'.
    *IF SY-SUBRC = 0.
    *MOVE 'USER_COMMAND' TO WA_EVENTS-FORM.
    *MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX."TRANSPORTING FORM WHERE NAME = 'WA_EVENT-NAME'.
    *ENDIF.
    READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'LIST_MODIFY'.
    IF SY-SUBRC = 0.
    MOVE 'LIST_MODIFY' TO WA_EVENTS-FORM.
    MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
    ENDIF.
    *READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'PF_STATUS_SET'.
    *IF SY-SUBRC = 0.
    *MOVE 'PF_STATUS_SET' TO WA_EVENTS-FORM.
    *MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
    *ENDIF.
    ENDFORM.                    " F_EVENTSGET
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01 .
    *&      Form  F_ALVGRIDDISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM F_ALVGRIDDISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                =  SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'F_POCHANGEPFSTATUS'
       I_CALLBACK_USER_COMMAND           = 'F_POCHNGUSERCOMMAND'
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = I_LAYOUT
       IT_FIELDCAT                       = I_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'U'
      IS_VARIANT                        =
       IT_EVENTS                         = I_EVENTS
      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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = I_FINAL
    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.
    *CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DATA_GET'
    EXPORTING
       I_HEADER_TABNAME       =
       I_ITEM_TABNAME         =
    IMPORTING
      ET_FIELDCAT            =
      ET_SORT                =
    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.
    ENDFORM.                    " F_ALVGRIDDISPLAY
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01 .
    *&      Form  F_POCHANGECHECK
          text
    -->  p1        text
    <--  p2        text
    FORM F_POCHANGECHECK.
    ENDFORM.                    " F_POCHANGECHECK

    Hi
    I sure that there is a better way,but this one will work also...
    In PBO enter rows you will show in report to itab you define (same type)
    In PAI (after change) compare this tables (your grid table and itab with values before the change) and you will get rows which have been changed...
    REGARDS
    Yossi

  • How to disable the custom push button in Classic ALV

    Hi All,
    Iam Using Classic Alv (with out classes).I have a created a push button.now at run time i want to make it dynamic .
    iam using REUSE_ALV_GRID_DISPLAY
    for ex.
    i have some records in my out put.
    i have a push button "INSERT"
    For first time when i clicked it will be inserted.
    Now if i run the report for the same inputs as top,i will get the records.But the "INSERT" push button should be disable.IS that Possible ??
    If yes kindly send me the solution.

    Hi,
    Here is the piece of code for your understanding...
    FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
      REFRESH i_extab.
      PERFORM f4210_exclude_fcodes CHANGING i_extab.( This form is mentioned below ).
      SET PF-STATUS 'STANDARD' OF PROGRAM '(Program name)' EXCLUDING i_extab.( This line of code will excude the function u don't want)
    ENDFORM.
    FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
      DATA: ws_fcode TYPE slis_extab.
      CLEAR ws_fcode.
      ws_fcode = '&EB9'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&ABC'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&NFO'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&LFO'.          
      APPEND ws_fcode TO i_extab.
    ENDFORM.                    " f4210_exclude_fcodes
    I hope this clarifies. Revert for any queries.
    Cheers,
    Venkat

  • Trigger DATA_CHANGED event from triggered DATA_CHANGED event in second ALV

    Hello,
    I do have 2 ALVs (class CL_GUI_ALV_GRID) in a Splitter-Control.
    Both ALVs do have registered the event DATA_CHANGED in seperate handler methods.
    If there is a change in first ALV(line insertion with values), there will be inserted a new line with values in the second ALV.  After handling the event at first ALV, I call CHECK_CHANGED_DATA of the second ALV and REFRESH_TABLE_DISPLAY of the second ALV. I would expect that the call of CHECK_CHANGED_DATA would trigger the event DATA_CHANGED, but it does not trigger the event DATA_CHANGED of the second ALV.
    The problem is maybe that the input at the data is not made by the user(UI).
    What could I do to trigger this event and check the new data at second ALV?
    Yours Joerg

    Hello ,
    yeah thats correct , but in your case what you can do is
    g_grid1(first alv) >CHECK_CHANGED_DATA( Importing E_VALID =  l_Valid )>in the implementation method of this ..update global variable g_second = 'X' in order to refresh ALV2.
    g_grid1(first alv) -->Refresh_table_display( ).
    if g_second = 'X'.
    g_grid2-->SET_TABLE_FOR_FIRST_DISPLAY. so it will refresh the second alv contents.
    endif.
    regards
    Prabhu

  • Events in classical report

    Hi Gurus,
    Please provide me the correct sequence of all possible events in a classical report.
    Thanks,
    Binay

    Hi,
    Events in Classical List Proceesing:
    When u start the Report:
    LOAD-OF-PROGRAM
    INITIALIZATION
    Before displayins Selection Screen:
    AT SELECTION-SCREEN OUTPUT.
    Before leaving Selection Screen:
    AT SELECTION-SCREEN.
    After processing Selection Screen when the List starts:
    START-OF-SELECTION.
    Before displaying the List .. After completing START-OF-SELECTION.
    END-OF-SELECTION.
    For Every page:
    TOP-OF-PAGE .
    END-OF-PAGE.
    For more details check this link -
    Events in Report
    Reward points if found helpful…..
    Cheers,
    Chandra Sekhar.

  • OO ALV to classic ALV

    I need to change my report list from OO ALV to classic grid , but there are some functionalities which I do not apply to the classic ALV . Can you help me..? Functionalities are listed below
      CALL METHOD grid_201->set_toolbar_interactive.
      CALL METHOD grid_201->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
      CALL METHOD grid_201->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter. "event_id = 18
      CREATE OBJECT event_receiver_201
        TYPE
          lcl_event_receiver.
      SET HANDLER event_receiver_201->handle_data_changed_finished FOR ALL INSTANCES.

    Hi,
    Please refer to the following link where detailed information is available:
    http://help.sap.com/saphelp_nw04/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm

  • ALV Control and Classical ALV

    Hi all,
    Please let me know the advantages and disadvantages of ALV control over Classical ALV.
    Thanks & regards,
    Naresh.

    ALV LIST Can be coded using only FMs
    ALV control  Can be coded using FMs and object oriented concepts
    ALV LIST Can be displayed hieraicharlly
    ALV GRID cannot be displayed hierarichally
    Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.

  • How to Process event when select ALV mark ?

    Hi.
    The Screen have ALV data.
    How to Process event when select ALV mark ?
    Regards.
    LY.

    EVENT
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_events[]
        EXCEPTIONS
          list_type_wrong = 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.
      READ TABLE it_events WITH KEY name = slis_ev_top_of_page
                                    INTO it_events.
      IF sy-subrc = 0.
        MOVE t_formname_top_of_page TO it_events-form.
        APPEND it_events.
      ENDIF.
    ALV
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat        = it_fieldcat
          it_events          = it_events[]
          i_callback_program = sy-repid
          is_layout          = gs_layout
          i_save             = g_save
          is_variant         = gx_variant
        TABLES
          t_outtab           = i_data[].

  • Classical ALV

    How to display ALV GRID in the middle of the screen.I am using classical ALV not OOP's concept.
    Thanks in Advance,
    Sumithra

    Hi,
    If you are using reuse_alv_grid_display, have a look at the parameters.
    I_SCREEN_START_COLUMN        
    I_SCREEN_START_LINE          
    I_SCREEN_END_COLUMN          
    I_SCREEN_END_LINE            
    Fill the necessary values and try the output.

  • Default event in classical reports

    what is the default event in classical reports?
    Regards,
    pandu.

    hi,
    Let us take you developed a program then LOAD-OF-PROGRAM and INITIALIZATION  these will be fired first when running the program, before the selection screen, if there is one, is fired.
    If there is a selection screen, AT SELECTION-SCREEN OUTPUT event will be fired automatically before the screen is shown.
    Also, if there is a selection screen, the START-OF-SELECTION event will only be fired when the user clicks the "Execute" button on the selection screen.
    TOP-OF-PAGE will automically be fired when you use the first WRITE statement as well as anytime the line count is reached.

  • ABAP WebDynpro: Handling the ON_ENTER Event in editable ALVs

    Sub: ABAP WebDynpro : Handling the ON_ENTER Event in editable ALVs
    Hi,
    I would like to know if there exists an event to handle TABout (i.e, when user navigates out of the cell with a TAB key-press) for a cell of an editable ALV.
    Alternatively, any help on how to handle ON_ENTER event and how it is triggered when data is entered by user into a cell of an editable ALV, would be really appreciated.
    Thanks,
    Adithya

    Hi
    I had one similar problem where user enter something into the editable cell and press enter. to handle this scenario i used WDDOBEFOREACTION  method of my view to call alv interface method check_data.
    if there is any change in the any table cell, it will fire an event on_data_check..which has paramater column name, row index and new and old value of the cell.
    you can handle this event and write your business logic in event handler method.
    hope it will help
    Regards
    Saurabh Garg

  • Search Help in Classical ALV

    Hi All,
    I have a small problem. Can anybody tell me how can i add a search help to a specific column in my classical ALV?
    Regards,
    Prakash Pandey

    Hi Prakash,
    In the Field Catalog there are two fields which are used to get the Search Help of any of the Column in ALV. Those are : REF_FIELDNAME and REF_TABNAME.
    For example,
      ls_fieldcat-fieldname  = 'VBELN'.
      ls_fieldcat-fix_column = 'X'.
      ls_fieldcat-key        = 'X'.
      ls_fieldcat-outputlen  = '10'.
      ls_fieldcat-seltext_m  = 'Sales Document'.
      ls_fieldcat-edit       = 'X'.
      ls_fieldcat-ref_fieldname = 'VBELN'.
      ls_fieldcat-ref_tabname = 'VBAP'.
      append ls_fieldcat to p_fieldcat.
      clear ls_fieldcat.
    The above code will show the F4 for the column VBELN in the ALV.

  • Classical report to classical ALV report

    Hi All,
           Please help in converting classical report to classical ALV report as in my classical report between the program ,after calculation block i have deleted all the WRITE statement  to convert it into classical ALV and after end of the program i have used
      PERFORM LAYOUT_INIT    USING    gs_layout.
      PERFORM COMMENT_BUILD  USING    gt_list_top_of_page[].
      PERFORM build_fldcat   CHANGING field_cat1.
      PERFORM build_layout.
      PERFORM set_events     CHANGING lt_events.
    and FM Reuse_alv_grid_display.
    Please suggest the right way where to use these perform statements & the FM Reuse_alv_grid_display.
    either in place of the deleted write statements or any where else in the program so that the calculation part output is displayed in Grid  form.
    Thanks.

    use in place of the write statements only....
    Regards,
    SAPient

  • WHAT ARE EVENTS IN AN ALV REPORT ?

    WHAT ARE EVENTS IN AN ALV REPORT ? PLEASE EXPLAIN HOW TO MAKE AN ALV REPORT AND WHAT THE EVENTS DO ?
    BEST REGARDS,
    RYAN

    Events are driven by user interaction...Like...
    DATA_CHANGED
    DOUBLE_CLICK
    ONF4
    Here's a sample code of OO ALV using events...
    *& Report  ZDUMMY_ATG_2
    REPORT zdummy_atg_2.
    TYPES: BEGIN OF ty_scarr,
           carrid TYPE scarr-carrid,
           carrname TYPE scarr-carrname,
           currcode TYPE scarr-currcode,
           END OF ty_scarr.
    DATA: t_spfli TYPE STANDARD TABLE OF spfli,
          w_spfli LIKE LINE OF t_spfli,
          lt_f4 TYPE lvc_t_f4 WITH HEADER LINE,
          return_tab TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE,
          t_custom_scarr TYPE STANDARD TABLE OF ty_scarr WITH HEADER LINE,
          t_stable TYPE STANDARD TABLE OF lvc_s_stbl WITH HEADER LINE.
    FIELD-SYMBOLS: <fs_spfli> LIKE LINE OF t_spfli,
                   <fs_scarr> LIKE LINE OF t_custom_scarr.
    CLASS cl_gui_object DEFINITION LOAD.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    INCLUDE <cl_alv_control>.
    DATA: ok_code LIKE sy-ucomm,
          gt_fieldcat TYPE lvc_t_fcat,
          gt_sort TYPE lvc_t_sort,
          event_receiver TYPE REF TO lcl_event_receiver,
          gs_layout TYPE lvc_s_layo,
          mycontainer TYPE scrfname VALUE 'CUSTOM_ALV',
          custom_container TYPE REF TO cl_gui_custom_container,
          grid1 TYPE REF TO cl_gui_alv_grid,
          gs_variant TYPE disvariant,
          x_save,
          w_error TYPE c,
          l_valid(1) TYPE c.
    *       CLASS LCL_EVENT_RECEIVER DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS: handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed,
          handle_f4_help
          FOR EVENT onf4 OF cl_gui_alv_grid
          IMPORTING e_fieldname es_row_no er_event_data.
    ENDCLASS.                    "LCL_EVENT_RECEIVER DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed.
        PERFORM data_changed USING er_data_changed.
      ENDMETHOD.                    "HANDLE_DATA_CHANGED
      METHOD handle_f4_help.
        PERFORM handle_onf4 USING e_fieldname es_row_no.
        er_event_data->m_event_handled = 'X'.
      ENDMETHOD.                    "HANDLE_F4_HELP
    ENDCLASS.                    "LCL_EVENT_RECEIVER IMPLEMENTATION
    *&      START-OF-SELECTION                                             *
    START-OF-SELECTION.
      PERFORM cargar_customs.
      PERFORM cargar_datos.
      PERFORM fill_layout.
      PERFORM fill_catalog.
      PERFORM llamar_alv.
      CALL SCREEN 0100.
    *&      Form  CARGAR_DATOS                                             *
    FORM cargar_datos.
      SELECT mandt carrid connid countryfr cityfrom
             airpfrom countryto cityto airpto
             fltime deptime arrtime distance
             distid fltype period
      INTO TABLE t_spfli
      FROM spfli.
    ENDFORM.                    " CARGAR_DATOS
    *&      Form  CARGAR_CUSTOMS                                           *
    FORM cargar_customs.
      SELECT carrid carrname currcode
      INTO TABLE t_custom_scarr
      FROM scarr.
    ENDFORM.                    " CARGAR_DATOS
    *&      Form  FILL_LAYOUT                                              *
    FORM fill_layout.
      gs_layout-sel_mode = 'A'.
    ENDFORM.                    " FILL_LAYOUT
    *&      Form  FILL_CATALOG                                             *
    FORM fill_catalog.
      DATA: gs_fieldcat TYPE lvc_s_fcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 1.
      gs_fieldcat-fieldname = 'CARRID'.
      gs_fieldcat-reptext   = 'Compañia'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = 'X'.
      gs_fieldcat-f4availabl = 'X'.
      gs_fieldcat-outputlen = '8'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 2.
      gs_fieldcat-fieldname = 'CONNID'.
      gs_fieldcat-reptext   = 'Conexión'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = 'X'.
      gs_fieldcat-outputlen = '8'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 3.
      gs_fieldcat-fieldname = 'COUNTRYFR'.
      gs_fieldcat-reptext   = 'País'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = 'X'.
      gs_fieldcat-outputlen = '4'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 4.
      gs_fieldcat-fieldname = 'CITYFROM'.
      gs_fieldcat-reptext   = 'Ciudad Salida'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = space.
      gs_fieldcat-outputlen = '20'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 5.
      gs_fieldcat-fieldname = 'AIRPFROM'.
      gs_fieldcat-reptext   = 'Arp. Salida'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = 'X'.
      gs_fieldcat-outputlen = '10'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 6.
      gs_fieldcat-fieldname = 'COUNTRYTO'.
      gs_fieldcat-reptext   = 'País'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = 'X'.
      gs_fieldcat-outputlen = '4'.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-col_pos   = 7.
      gs_fieldcat-fieldname = 'CITYTO'.
      gs_fieldcat-reptext   = 'Ciudad Llegada'.
      gs_fieldcat-tabname   = 'T_SPFLI'.
      gs_fieldcat-edit      = space.
      gs_fieldcat-outputlen = '20'.
      APPEND gs_fieldcat TO gt_fieldcat.
    ENDFORM.                    " FILL_CATALOG
    *&      Form  LLAMAR_ALV                                               *
    FORM llamar_alv.
      IF custom_container IS INITIAL.
        CREATE OBJECT custom_container
          EXPORTING
            container_name              = mycontainer
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5.
      ENDIF.
      CREATE OBJECT grid1
        EXPORTING
          i_parent = custom_container.
      CREATE OBJECT event_receiver.
      lt_f4-fieldname = 'CARRID'.
      lt_f4-register = 'X' .
      lt_f4-getbefore = 'X' .
      lt_f4-chngeafter = 'X' .
      APPEND lt_f4.
      SET HANDLER event_receiver->handle_data_changed FOR grid1.
      SET HANDLER event_receiver->handle_f4_help FOR grid1.
      CALL METHOD grid1->register_f4_for_fields
        EXPORTING
          it_f4 = lt_f4[].
      IF sy-batch IS INITIAL.
        CALL METHOD grid1->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      ENDIF.
      CALL METHOD grid1->set_table_for_first_display
        EXPORTING
          is_variant      = gs_variant
          i_save          = x_save
          i_default       = 'X'
          is_layout       = gs_layout
        CHANGING
          it_fieldcatalog = gt_fieldcat
          it_sort         = gt_sort[]
          it_outtab       = t_spfli[].
      CALL METHOD grid1->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
    ENDFORM.                    " LLAMAR_ALV
    *&      Form  HANDLE_ONF4                                              *
    FORM handle_onf4 USING p_e_fieldname
                           p_es_row_no STRUCTURE lvc_s_roid.
      CASE p_e_fieldname.
        WHEN 'CARRID'.
          CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
            EXPORTING
              retfield        = 'CARRID'
              value_org       = 'S'
            TABLES
              value_tab       = t_custom_scarr
              return_tab      = return_tab
            EXCEPTIONS
              parameter_error = 1
              no_values_found = 2
              OTHERS          = 3.
          IF NOT return_tab[] IS INITIAL.
            READ TABLE return_tab INDEX 1.
            READ TABLE t_spfli INDEX p_es_row_no-row_id
            ASSIGNING <fs_spfli>.
            <fs_spfli>-carrid = return_tab-fieldval.
            CALL METHOD grid1->refresh_table_display
              EXPORTING
                is_stable = t_stable.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " HANDLE_ONF4
    *&      Module  STATUS_0100  OUTPUT                                    *
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'MAIN_STATUS'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT                               *
    MODULE user_command_0100 INPUT.
      ok_code = sy-ucomm.
      CASE ok_code.
        WHEN 'BACK' OR 'STOP' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'SAVE'.
          CALL METHOD grid1->check_changed_data
            IMPORTING
              e_valid = l_valid.
          IF l_valid EQ 'X'.
            PERFORM grabar_datos.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  DATA_CHANGED                                             *
    FORM data_changed USING rr_data_changed TYPE REF TO
                                            cl_alv_changed_data_protocol.
      DATA: w_new,
            ls_mod_cells TYPE lvc_s_modi,
            ls_cells TYPE lvc_s_modi.
      DATA: l_carrid TYPE spfli-carrid.
      CLEAR l_carrid.
      LOOP AT rr_data_changed->mt_good_cells INTO ls_mod_cells.
        CASE ls_mod_cells-fieldname.
          WHEN 'CARRID'.
            CALL METHOD rr_data_changed->get_cell_value
              EXPORTING
                i_row_id    = ls_mod_cells-row_id
                i_fieldname = ls_mod_cells-fieldname
              IMPORTING
                e_value     = l_carrid.
            IF l_carrid IS INITIAL.
              CALL METHOD rr_data_changed->add_protocol_entry
                EXPORTING
                  i_msgid     = '0K'
                  i_msgno     = '000'
                  i_msgty     = 'E'
                  i_msgv1     = 'Seleccione algún código'
                  i_fieldname = ls_mod_cells-fieldname
                  i_row_id    = ls_mod_cells-row_id.
              w_error = 'X'.
            ELSE.
              READ TABLE t_custom_scarr WITH KEY carrid = l_carrid
              ASSIGNING <fs_scarr>.
              IF sy-subrc NE 0.
                CALL METHOD rr_data_changed->add_protocol_entry
                  EXPORTING
                    i_msgid     = '0K'
                    i_msgno     = '000'
                    i_msgty     = 'E'
                    i_msgv1     = 'Código ingresado no existe'
                    i_fieldname = ls_mod_cells-fieldname
                    i_row_id    = ls_mod_cells-row_id.
                w_error = 'X'.
              ENDIF.
            ENDIF.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " DATA_CHANGED
    *&      Form  GRABAR_DATOS                                             *
    FORM grabar_datos.
      LOOP AT t_spfli ASSIGNING <fs_spfli>.
        w_spfli = <fs_spfli>.
        MODIFY spfli FROM w_spfli.
        IF sy-subrc EQ 0.
          COMMIT WORK.
        ELSE.
          ROLLBACK WORK.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GRABAR_DATOS
    Greetings,
    Blag.

  • How to handle the event "GROUPLEVEL_CHANGE" in ALV?

    Hi,
    I have done a BLOCL ALV report. In i am sorting the first field and not displaying it. But for every change in the first field page break should happen and the particular field is to be printed at every page break at the top. I am handling the page break by passing the IT_SORT-GROUP = '*'. there fore the page breaking is happening well. now i need to have a control such that i print the first field at every page break.
    Please help on this...........
    I think the event GROUPLEVEL_CHANGE is to used please tell me the parameters to be passed for this subroutine
    (Defenitely point will be given)

    Hi,
    Check the below thread...
    Re: Adding row after subtotal in ALV
    Regards,
    Maha

Maybe you are looking for