Skip to Content
avatar image
-3
Former Member

PF status different behavior in function call and factory method

i copied one standard pf status when i am using that pf status bu function call alv the send to option of menu working fine and i am also getting all function keys , but when i am using the samr pf status ion alv factory method its only showing some function keys and send to option from menu bar is also grayed out. pls provide the solution

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 12, 2017 at 08:05 AM

    Technically speaking, the standard GUI status for REUSE_ALV_GRID_DISPLAY and for SALV look the same but are technically distinct (respectively one is from program SAPLKKBL and the other is from SAPLSLVC_FULLSCREEN), so you should better copy the one from SALV and add your own custom buttons, instead of using the one you copied from SAPLKKBL.

    But please, which standard GUI status did you originally copy (STANDARD, STANDARD_FULLSCREEN, ...), and which keys/menus are enabled using REUSE_ALV_GRID_DISPLAY, and are disabled/grayed out with SALV?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2017 at 02:01 AM

    Try below code

    go_salv->get_functions( )->set_all( ).
    Add comment
    10|10000 characters needed characters exceeded

    • It works for me:

      with PF_STATUS copied from GUI status STANDARD of SAPLKKBL, and this complete executable code:

      REPORT.
      DATA gt_final TYPE TABLE OF sflight.
      CLASS lcl_app DEFINITION.
        PUBLIC SECTION.
          CLASS-METHODS display_data.
      ENDCLASS.
      CLASS lcl_app IMPLEMENTATION.
        METHOD display_data.
          "object reference for cl_salv_table
          DATA : lr_alv TYPE REF TO cl_salv_table,
          lv_repid TYPE sy-repid,
          gr_functions TYPE REF TO cl_salv_functions,
          "object reference for columns and column
          l_cols_tab TYPE REF TO cl_salv_columns_table,
          l_col_tab TYPE REF TO cl_salv_column_table.
          CONSTANTS: lc_pf_status TYPE sypfkey VALUE 'STANDARD_PF1'.
          lv_repid = sy-repid.
      
          "alv grid fm, pass your internal table
          TRY.
              CALL METHOD cl_salv_table=>factory
                IMPORTING
                  r_salv_table = lr_alv
                CHANGING
                  t_table      = gt_final.
            CATCH cx_salv_msg .
          ENDTRY.
          lr_alv->get_functions( )->set_all( ).
      
          TRY.
            CALL METHOD lr_alv->set_screen_status
              EXPORTING
                report        = sy-repid
                pfstatus      = 'PF_STATUS'
                set_functions = lr_alv->c_functions_all.
          ENDTRY.
      
          "field catalog of table
          CALL METHOD lr_alv->get_columns
            RECEIVING
              value = l_cols_tab.
          TRY.
              l_col_tab ?= l_cols_tab->get_column( 'CARRID' ).
              CALL METHOD l_col_tab->set_short_text
                EXPORTING
                  value = 'gc_vblen_s'.
              CALL METHOD l_col_tab->set_long_text
                EXPORTING
                  value = 'gc_vblen_l'.
              CALL METHOD l_col_tab->set_output_length
                EXPORTING
                  value = 30.
            CATCH cx_salv_not_found .
          ENDTRY.
          "call display method of lr_alv
          lr_alv->display( ).
        ENDMETHOD.
      ENDCLASS.
      START-OF-SELECTION.
        PERFORM main.
      FORM main.
        SELECT * FROM sflight INTO TABLE gt_final.
        lcl_app=>display_data( ).
      ENDFORM.
      
      vaqvo.png (23.3 kB)