Skip to Content
-3

PF status different behavior in function call and factory method

Sep 10, 2017 at 09:33 AM

121

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sandra Rossi Sep 12, 2017 at 08:05 AM
0

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?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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.

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

Try below code

go_salv->get_functions( )->set_all( ).
Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

i tryed this but it is not working

0

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
Former Member

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
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)
0