sapdev logo background
sapdev logo sapdev logo
Comments

Add User command functionality to ALVgrid report




In order modify PF_STATUS of ALV grid report you need to perform the following steps:

Step 1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
      i_callback_pf_status_set = 'SET_PF_STATUS' statement.

Step 2. Create 'SET_PF_STATUS' FORM

Step 3. Create pf_status (i.e. 'ZNEWSTATUS').
- It is recommend that you copy standard status 'STANDARD' from function group SALV or 'STANDARD_FULLSCREEN' from function group SLVC_FULLSCREEN which is what I tend to use, and then modify it accordingly. ALV standard function codes always start with '&'. i.e. &VGRID calls your ALV grid


 call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'
            i_callback_pf_status_set = 'SET_PF_STATUS'   "see FORM 
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       exceptions
            program_error           = 1
            others                  = 2.


*----------------------------------------------------------*
*       FORM SET_PF_STATUS                                 *
*----------------------------------------------------------*
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZNEWSTATUS'.
                  "Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.



comments powered by Disqus