Application Development and Automation 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: 
Read only

CL_SALV_TABLE settings layout saving disabled

Former Member
0 Likes
14,809

Hi all,

I have tried serching around but can't seem to find a solution that pertains to CL_ALV_TABLE ALVs that answers my question. I need to find out how to allow the settings>layout>saving functionality can be enabled. I have tried checking into the methods myself and have not found one that works. I have also found some suggestions that involve CL_SALV_LAYOUT method set_save_restriction, however it does not seem to enable the functionality I am looking for. The examples I have found involve this approach:

lo_layout = lo_alv->get_layout( ).

lo_layout->set_save_restriction( cl_salv_layout=>restrict_none ).

Is this the same functionality I would be enabling- the settings>layout>saving functionality from the system menu bar, or is there something else that would need to be done? The above example ends where all examples I have found end.

Thanks in advance for any help.

Zack

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
7,509

You must also use the SET_KEY method of CL_SALV_LAYOUT to pass program (and handle) value.

lr_layout = lr_alv->get_layout( ).

ls_key-report = sy-repid.

lr_layout->set_key( ls_key ).

lr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).

Read class documentation.

Regards

Raymond

You must also use the SET_KEY method of CL_SALV_LAYOUT to pass program (and handle) value.

lr_layout = lr_alv->get_layout( ).

ls_key-report = sy-repid.

lr_layout->set_key( ls_key ).

lr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).

Read class documentation.

Regards

Raymond

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
7,510

You must also use the SET_KEY method of CL_SALV_LAYOUT to pass program (and handle) value.

lr_layout = lr_alv->get_layout( ).

ls_key-report = sy-repid.

lr_layout->set_key( ls_key ).

lr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).

Read class documentation.

Regards

Raymond

Read only

0 Likes
7,509

Thanks for your help, I had read the documentation but didn't quite get how the key actually played a role, and misread the key as another object instead of structure.

Read only

0 Likes
7,509

In fact "key" is actually the key of LTDX and related files that store the ALV variants.

Regards,

Raymond

Read only

0 Likes
7,509

One thing that I've discovered is that some authorization objects apparently turn off the ability to store a default variant in SALV.  In one situation, I found that (in addition to Raymond's list of computes and method calls) I have to do:

  gr_layout->set_default( if_salv_c_bool_sap=>true ).

to allow the user to be able to set a "default" layout.   Without that, the default checkbox is not available for input.

Read only

0 Likes
7,509

Do you mean S_ALV_LAYO authorization object, which manage authority to save standard (cross-user) layout ?

Read only

Former Member
0 Likes
7,509

Hi,

      If u are developing ALV by using OOPS concept,

      Then plase set I_SAVE parameter of method SET_TABLE_FOR_FIRST_DISPLAY to as follow.

  

Determines the options available to the user for saving a layout:

  • 'X':         global saving only 
  • 'U':         user-specific saving only 
  • 'A':         corresponds to 'X' and 'U' 
  • SPACE:   no saving