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: 

CL_SALV_TREE save layout

Former Member
0 Kudos

Hello all,

I am working with the CL_SALV_TREE, in which I display a tree. Now I have implemented the SALV_FUNCTION for LAYOUT.

If I click the layout button, there is no posibility to save the user spezified layout.

Also at the context menu of the layout group ist no entry for save.

I have set the buttons with the following code:

data: mr_tree   type ref to cl_salv_tree.

* first I create a tree correctly.

  mr_tree->set_screen_status(
    pfstatus      =  i_pfstatus
    report        =  sy-repid
    set_functions =  mr_tree->c_functions_all ).

  mr_functions = mr_tree->get_functions( ).
  mr_functions->set_all( abap_true ).
  mr_functions->set_layout_change( abap_true ).
  mr_functions->set_layout_load( abap_true ).
  mr_functions->set_layout_save( abap_true ).
  mr_functions->set_print_view( abap_false ).
  mr_functions->set_find( abap_false ).
  mr_functions->set_group_aggregation( abap_false ).

I set the layout with the following function:

data: ls_key       type SALV_S_LAYOUT_KEY,
        ls_layout    type SALV_S_LAYOUT.

  if not mr_layout is bound.

    mr_layout = mr_tree->get_layout( ).

    ls_key-report = m_repid.

    mr_layout->set_key( ls_key ).

    mr_layout->set_default( abap_true ).

    mr_layout->set_save_restriction( 3 ).

    mr_layout->set_initial_layout( space ).

  endif.

Can sombody tell me, why I can't save the layout in combination with the CL_SALV_TREE class???

Yours Joerg

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You code looks good, I would think that it would work, but I don't think you need these lines.

mr_functions->set_layout_change( abap_true ).

mr_functions->set_layout_load( abap_true ).

mr_functions->set_layout_save( abap_true ).

Regards,

Rich Heilman

Former Member
0 Kudos

Hello Rich,

thanks for your answer.

I commented this three lines, but no change.

Yours Joerg

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you setting a custom status here?

mr_tree->set_screen_status(
    pfstatus      =  i_pfstatus                  "<---  HEre

Regards,

RIch Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Just to be clear, you do realize that the save layout functionality is a separate button next to the select layout button which is next to the change layout button.

Regards,

Rich Heilman

Former Member
0 Kudos

Dear Rich,

yes I set a status, but that does not have any effect to the tree.

Yours Joerg

0 Kudos

I'm not sure what the problem is, it is all working good in my system.

Regards,

Rich Heilman

Former Member
0 Kudos

Which SAP-Basis and Support-Package are you running? I am running on 700.08

Yours Joerg

0 Kudos

Netweaver 04s SP10(7.0 SP10)

Regards,

Rich Heilman

Former Member
0 Kudos

So I will build SAP-Note 923792.

Maybe that works, what do you think?

Former Member
0 Kudos

The SAP-Note solfed the problem.