4 Replies Latest reply: Oct 4, 2007 10:25 AM by Varma Narayana RSS

How to use 'I_CALLBACK_PF_STATUS_SET' in REUSE_ALV_GRID_DISPLAY FM

megha waykar
Currently Being Moderated

I am using REUSE_ALV_GRID_DISPLAY function module

I want to use I_CALLBACK_PF_STATUS_SET' that field & show menu bar which I create but it's not showing that menu bar?

I am using following coding :

Please guide me..............

 

DOWNLOAD = 'MM'.

   SET PF-STATUS 'MM'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

   EXPORTING

  •   I_INTERFACE_CHECK                 = ' '

  •   I_BYPASSING_BUFFER                = ' '

  •   I_BUFFER_ACTIVE                   = ' '

     I_CALLBACK_PROGRAM                = 'ZVR_INEX'

     I_CALLBACK_PF_STATUS_SET          = DOWNLOAD

  •      I_CALLBACK_USER_COMMAND           = 'HANDLE_USER_COMMAND'(005)

  •   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                         =

     IT_FIELDCAT                       = FIELDCAT_T

  •   IT_EXCLUDING                      =

  •   IT_SPECIAL_GROUPS                 =

  •   IT_SORT                           =

  •   IT_FILTER                         =

  •   IS_SEL_HIDE                       =

  •   I_DEFAULT                         = 'X'

  •   I_SAVE                            = ' '

  •   IS_VARIANT                        =

  •   IT_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_VBPA

  • 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.

  • Re: How to use 'I_CALLBACK_PF_STATUS_SET' in REUSE_ALV_GRID_DISPLAY FM
    Bharat Kalagara
    Currently Being Moderated

    HI,

     

    see this example.

    REPORT ZBHALV_LIST1.

     

    TABLES:MARA.

     

    SELECT-OPTIONS: MATNR FOR MARA-MATNR.

     

    DATA:BEGIN OF ITAB OCCURS 0,

         MATNR LIKE MARA-MATNR,

         ERSDA LIKE MARA-ERSDA,

         MTART LIKE MARA-MTART,

         MBRSH LIKE MARA-MBRSH,

    END OF ITAB.

     

    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR

    IN MATNR.

     

    TYPE-POOLS SLIS.

     

    DATA:FCAT TYPE slis_t_fieldcat_alv.

    DATA:LAYOUT TYPE slis_layout_alv.

    DATA:EVE TYPE slis_t_event WITH HEADER LINE.

    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.

    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.

     

    SORT-UP = 'X'.

    SORT-SPOS = 1.

    SORT-FIELDNAME = 'ERSDA'.

    SORT-tabname = 'MARA'.

    APPEND SORT.

     

    SORT-SPOS = 2.

    SORT-FIELDNAME = 'MTART'.

    SORT-tabname = 'MARA'.

    APPEND SORT.

     

     

    EVE-NAME = 'TOP_OF_PAGE'.

    EVE-FORM = 'TOPOFPAGE'.

    APPEND EVE.

     

    EVE-NAME = 'TOP_OF_LIST'.

    EVE-FORM = 'TOPOFLIST'.

    APPEND EVE.

     

    EVE-NAME = 'END_OF_LIST'.

    EVE-FORM = 'ENDOFLIST'.

    APPEND EVE.

     

    LAYOUT-ZEBRA = 'X'.

    LAYOUT-no_hline = 'X'.

    LAYOUT-NO_VLINE = 'X'.

    LAYOUT-window_titlebar = 'MATERIAL DETAILS'.

     

     

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

       I_PROGRAM_NAME               = SY-REPID

       I_INTERNAL_TABNAME           = 'ITAB'

    •   I_STRUCTURE_NAME             =

    •   I_CLIENT_NEVER_DISPLAY       = 'X'

       I_INCLNAME                   = SY-REPID

    •   I_BYPASSING_BUFFER           =

    •   I_BUFFER_ACTIVE              =

      CHANGING

        CT_FIELDCAT                  = FCAT

    • EXCEPTIONS

    •   INCONSISTENT_INTERFACE       = 1

    •   PROGRAM_ERROR                = 2

    •   OTHERS                       = 3

              .

    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_LIST_DISPLAY'

    EXPORTING

    •   I_INTERFACE_CHECK              = ' '

    •   I_BYPASSING_BUFFER             =

    •   I_BUFFER_ACTIVE                = ' '

       I_CALLBACK_PROGRAM             = SY-REPID

    <b>   I_CALLBACK_PF_STATUS_SET       = 'STATUS'</b>

       I_CALLBACK_USER_COMMAND        = 'UCOMM'

    •   I_STRUCTURE_NAME               =

       IS_LAYOUT                      = LAYOUT

       IT_FIELDCAT                    = FCAT

    •   IT_EXCLUDING                   =

    •   IT_SPECIAL_GROUPS              =

       IT_SORT                        = SORT[]

    •   IT_FILTER                      =

    •   IS_SEL_HIDE                    =

    •   I_DEFAULT                      = 'X'

    •   I_SAVE                         = ' '

    •   IS_VARIANT                     =

       IT_EVENTS                      = EVE[]

    •   IT_EVENT_EXIT                  =

    •   IS_PRINT                       =

    •   IS_REPREP_ID                   =

    •   I_SCREEN_START_COLUMN          = 5

    •   I_SCREEN_START_LINE            = 5

    •   I_SCREEN_END_COLUMN            = 120

    •   I_SCREEN_END_LINE              = 25

    • IMPORTING

    •   E_EXIT_CAUSED_BY_CALLER        =

    •   ES_EXIT_CAUSED_BY_USER         =

      TABLES

        T_OUTTAB                       = ITAB

    • 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 TOPOFPAGE.

    REFRESH HEAD.

        HEAD-TYP = 'H'.

        HEAD-INFO = 'MATERIALS'.

        APPEND HEAD.

     

        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

          EXPORTING

            IT_LIST_COMMENTARY       = HEAD[]

    •       I_LOGO                   =

    •       I_END_OF_LIST_GRID       =

                  .

    ENDFORM.

     

    FORM TOPOFLIST.

    REFRESH HEAD.

        HEAD-TYP = 'H'.

        HEAD-INFO = 'MATERIALS-LISTTOP'.

        APPEND HEAD.

     

        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

          EXPORTING

            IT_LIST_COMMENTARY       = HEAD[]

    •       I_LOGO                   =

    •       I_END_OF_LIST_GRID       =

                .

    ENDFORM.

     

    FORM ENDOFLIST.

    REFRESH HEAD.

        HEAD-TYP = 'H'.

        HEAD-INFO = 'MATERIALS-LISTEND'.

        APPEND HEAD.

     

        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

          EXPORTING

            IT_LIST_COMMENTARY       = HEAD[]

    •       I_LOGO                   =

    •       I_END_OF_LIST_GRID       =

                  .

    ENDFORM.

     

     

    <b>FORM STATUS USING MYMENU.

    *here MYMENU is the excluding buttons list

        SET PF-STATUS 'MENU' excluding MYMENU.

    ENDFORM.</b>

     

    FORM UCOMM USING CODE STEXT.

        CASE CODE.

            WHEN 'ABC'.

            WRITE:/ 'YOU HAVE CLICKED ON ABC'.

            WHEN 'XYZ'.

            WRITE:/ 'YOU HAVE CLICKED ON XYZ'.

        ENDCASE.

    ENDFORM.

     

    rgds,

    bharat.

  • Re: How to use 'I_CALLBACK_PF_STATUS_SET' in REUSE_ALV_GRID_DISPLAY FM
    Vinutha YV
    Currently Being Moderated

    hi,

     

    type-pools : slis,icon.

     

    data : gd_repid like sy-repid.

     

    gd_repid  =  sy-repid.

     

    call function module reuse_alv_grid_display.

     

    i_callback_program = gd_repid.

    i_callback_pf_status = 'SET_PF_STATUS'.

     

     

    tables .

    t_outtab = itab.

     

    form SET_PF_STATUS using rt_extab type slis_t_extab.

     

    set pf-status = 'NEWSTATUS'.

     

    endform.

     

     

    double click on NEWSTATUS.it will take u to a new pop up window where in we can select the menu's required by the user...

     

    Reward with points if helpful.

     

    Message was edited by:

            Vinutha YV

Actions