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_TABLE Sort position and Save default setting

Former Member
0 Kudos

Hi all

i try to create a new program with cl_SALV_TABLE but i have 2 parts with errors maybe somebody could help me

first; i would like to sort my itab means interntable has BSCHL COUNT ICON on Screen i would like to have ICON COUNT BSCHL

my code but it doesnt work ?



DATA:    gr_sorts        TYPE REF TO cl_salv_sorts.

*-
  gr_sorts = gr_table->get_sorts( ).

*-
  gr_sorts->add_sort( columnname = 'GROUP' subtotal = abap_true ).
  gr_sorts->add_sort( columnname = 'ICON' ).
  gr_sorts->add_sort( columnname = 'COUNT' sequence   = if_salv_c_sort=>sort_up ).
  gr_sorts->add_sort( columnname = 'BSCHL' ).

*-
  gr_sorts->set_position( columnname = 'ICON'  position   = 1 ).
  gr_sorts->set_position( columnname = 'COUNT' position   = 2  ).
  gr_sorts->set_position( columnname = 'BSCHL' position   = 3 ).

secount; i would like to save user-sepific and Default setting

my code but it doesnt work ? i could only user-specific....



DATA: 
gr_layout       TYPE REF TO cl_salv_layout,
l_key           TYPE salv_s_layout_key,

gr_layout = gr_table->get_layout( ).
*-

  l_key-report = sy-repid.
  gr_layout->set_key( l_key ).

  gr_layout->set_save_restriction(
  cl_salv_layout=>restrict_none ).

Thanks for help

4 REPLIES 4

Pawan_Kesari
Active Contributor
0 Kudos

>

>

> secount; i would like to save user-sepific and Default setting

>

> my code but it doesnt work ? i could only user-specific....

>

Regarding the layout user should have authority object S_LAYOUT in their profile to save global layouts. otherwise global layout saving will be disabled.

0 Kudos

Hi

I have sap_all ?!

naimesh_patel
Active Contributor
0 Kudos

The SET_POSITION for the SORT object should work.

Put a breakpoint in the method SET_POSITION in the class CL_SALV_SORTS and see, is it changing the sequence in the internal table ME->T_SORT?

Regards,

Naimesh Patel

0 Kudos

hi

yes but on the screen doesn't i have also run BALVBUFDEL to delete buffer but now right display ??