Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PF status different behavior in function call and factory method

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

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?

8 REPLIES 8

former_member200338
Active Contributor

Try below code


go_salv->get_functions( )->set_all( ).

0 Kudos

i tryed this but it is not working

0 Kudos

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( 'VBELN' ).
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.

0 Kudos

It should work (tested on 7.31 system). Make sure you have activated everything. Make sure there's no corrective SAP note for such symptom.

0 Kudos
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.

Sandra_Rossi
Active Contributor
0 Kudos

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?

0 Kudos

I have used STANDARD pf-status. and 'SEND to' option of list menu is grayed out. when i am using salv

0 Kudos

I did a test, based on SALV_TEST_TABLE_FUNCTIONS program. No issue (tested on 7.31 system). Make sure you have activated everything. Make sure there's no corrective SAP note for such symptom.