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

How to disable User-Specific checkbox in Save Layout of ALV designed by using cl_salv_table

former_member230535
Participant
0 Kudos
2,735

Dear all experts,

I have developed an ALV report by using cl_salv_table and the screen of Save Layout as this figure

I want to make User-Specific grey-out. How to get it? Please help me.

Dai Nguyen Quang,

Thanks.

1 ACCEPTED SOLUTION
Read only

franois_henrotte
Active Contributor
1,434

let's say that your SALV object is ob_salv_table, then you just have to call :

ob_salv_table->get_layout( )->set_save_restriction( if_salv_c_layout=>restrict_user_independant ).
4 REPLIES 4
Read only

SimoneMilesi
Active Contributor
1,434

It's a quite common question, already asked dozens of times: did you searched for it?

Because if you had done it, googling "cl_salv_table layout save user only" (or just checking CL_SALV_TABLE Wiki) you had found that the layout is handled by object CL_SALV_LAYOUT with all the options you need.


Read only

0 Kudos
1,434

Thanks for your reply. It is helpful.

Read only

franois_henrotte
Active Contributor
1,435

let's say that your SALV object is ob_salv_table, then you just have to call :

ob_salv_table->get_layout( )->set_save_restriction( if_salv_c_layout=>restrict_user_independant ).
Read only

0 Kudos
1,434

Thank you very much.

METHOD SET_LAYOUT.
*
DATA: LO_LAYOUT TYPE REF TO CL_SALV_LAYOUT,
LF_VARIANT TYPE SLIS_VARI,
LS_KEY TYPE SALV_S_LAYOUT_KEY.
*
* get layout object
LO_LAYOUT = CO_ALV->GET_LAYOUT( ).
*
* set Layout save restriction
* 1. Set Layout Key .. Unique key identifies the Differenet ALVs
LS_KEY-REPORT = SY-REPID.
LO_LAYOUT->SET_KEY( LS_KEY ).
* 2. Remove Save layout the restriction.
LO_LAYOUT->SET_SAVE_RESTRICTION( IF_SALV_C_LAYOUT=>RESTRICT_USER_INDEPENDANT ).
LO_LAYOUT->SET_DEFAULT( 'X' ).
*
* set initial Layout
* LF_VARIANT = 'DEFAULT'.
* LO_LAYOUT->SET_INITIAL_LAYOUT( LF_VARIANT ).
*
ENDMETHOD. "set_layout