Skip to Content
0
Former Member
Aug 05, 2009 at 01:48 PM

CL_SALV_TABLE Sort position and Save default setting

322 Views

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