RE: ALV Grid – User Defined Buttons

      Hi there,

      I am new to SAP and ABAP and this is my first time using SCN so hopefully someone can help me!

      I am trying to change the standard buttons on an ALV grid. There seem to be a few different ways of doing this but the way I have been trying to implement involves copying the GUI Status from another program (I have tried using SAPLKKBL)

      After successfully copying the GUI status I have added some code to set the status within my Z program (Z_CHANGE_ICONS_TEST).

      I have followed the instructions in other discussions which advise to include a form to set the pf status and then to call the pf status using the parameter – i_callback_pf_status_set = ‘ZSTANDARD’ within the ‘REUSE_ALV_GRID_DISPLAY’.

      I have done all this but when I execute, the ALV toolbar disappears as does the standard SAP toolbar so I can’t even back out to return to my code.

      If i remove the i_callback_pf_status_set then the toolbar comes back but I have no control over the icons.

      I’m sure there is a simple solution to my problem but a bit of help/advice would be much appreciated as I am rather stuck.

      My code is copied below.

      *&———————————————————————*

      *& Report  Z_ALV_CHANGE_ICONS_TEST

      *&

      *&———————————————————————*

      *&

      *&

      *&———————————————————————*

      REPORT  Z_ALV_CHANGE_ICONS_TEST.

      *&———————————————————————*

      *& Data Declaration

      *&———————————————————————*

      DATA: it_sflight   TYPE TABLE OF sflight,

             it_fieldcat  TYPE slis_t_fieldcat_alv,

             wa_fieldcat  TYPE slis_fieldcat_alv.

      *****************************************************************

      * Form Set_pf_status

      * Notes: Called by FM REUSE_ALV_GRID_DISPLAY

      *****************************************************************

      FORM set_pf_status USING rt_extab TYPE slis_t_extab.

         SET PF-STATUS ‘ZSTANDARD’.

      ENDFORM. “Set_pf_status

      *&———————————————————————*

      *& START-OF-SELECTION

      *&———————————————————————*

      START-OF-SELECTION.

      *Fetch data from the database

         SELECT * FROM sflight  INTO TABLE it_sflight.

      *Build field catalog

         wa_fieldcatfieldname  = ‘CARRID’.    ” Fieldname in the data table

         wa_fieldcatseltext_m  = ‘Airline Code’.   ” Column description in the output

         APPEND wa_fieldcat TO it_fieldcat.

      *Pass data and field catalog to ALV function module to display ALV list

         CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’

           EXPORTING

             it_fieldcat   = it_fieldcat

             i_callback_pf_status_set = ‘ZSTANDARD’

           TABLES

             t_outtab      = it_sflight

           EXCEPTIONS

             program_error = 1

             OTHERS        = 2.

      hi steven   you can write in that i_call_back_pf_status form name(set_pf_status)  not  pf_status(zstandard) name and also u can write form pf_status at the end of program i.e after call fm reuse_alv_grid_display         thanks&regarrds naveen

      User Rating: Be the first one !
      Add Comment
      1 Answers

        hi steven

         

        you can write in that i_call_back_pf_status form name(set_pf_status)  not  pf_status(zstandard) name and also u can write form pf_status at the end of program i.e after call fm reuse_alv_grid_display

         

         

         

         

        thanks&regarrds

        naveen

        Add Comment

        Your Answer

        By posting your answer, you agree to the privacy policy and terms of service.