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: 

Layout for Class CL_SALV_LAYOUT

former_member188001
Active Participant

Hello all,

Please find below the piece of code i am using.

PARAMETERS : p_vari TYPE slis_vari.

DATA: gr_alv TYPE REF TO cl_salv_table,

lr_layout TYPE REF TO cl_salv_layout.

*--- This code is to get the layout,save the layout and display the

  • layout

lr_layout = gr_alv->get_layout( ).

key-report = sy-repid.

lr_layout->set_key( key ).

lr_layout->set_save_restriction( cl_salv_layout=>restrict_none )

.

DATA: init_layout TYPE slis_vari.

init_layout = p_vari.

lr_layout->set_initial_layout( init_layout ).

*--- display report

gr_alv->display( ).

Now when the grid is being displayed, I am creating a layout. When I click on "Save Layout", a popup comes where we give the name for layout. If you see, there is a checkbox for "Default Setting". This checkbox is disabled in my case. I want to enable this checkbox.

Can anyone please help me out for the above problem.

Points rewarded for helpful answers.

Thanks,

Salil

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor

Hello Salil

Class CL_SALV_LAYOUT has a method <b>SET_DEFAUT</b> (<i>Allow default layout</i>). Perhaps you have to add the following statement:


lr_layout = gr_alv->get_layout( ).

lr_layout->set_default ( CL_SALV_LAYOUT=>true ).  " allow default

key-report = sy-repid.
lr_layout->set_key( key ).
lr_layout->set_save_restriction( cl_salv_layout=>restrict_none )

Regards

Uwe

2 REPLIES 2

uwe_schieferstein
Active Contributor

Hello Salil

Class CL_SALV_LAYOUT has a method <b>SET_DEFAUT</b> (<i>Allow default layout</i>). Perhaps you have to add the following statement:


lr_layout = gr_alv->get_layout( ).

lr_layout->set_default ( CL_SALV_LAYOUT=>true ).  " allow default

key-report = sy-repid.
lr_layout->set_key( key ).
lr_layout->set_save_restriction( cl_salv_layout=>restrict_none )

Regards

Uwe

0 Kudos

Hi Uwe,

Thanks a lot for your help. My problem got solved.

Regards,

Salil