Skip to Content
1
Aug 11, 2008 at 04:28 PM

cl_salv_table - Save Layout

18001 Views

I am using cl_salv_table to display an ALV but I can't get the save layout option to be available (in the menu path or on the toolbar). Is this not possible? Below is the code I am using to display:

  call method cl_salv_table=>factory
*    EXPORTING
*      list_display   = IF_SALV_C_BOOL_SAP=>FALSE
*      r_container    =
*      container_name =
    importing
      r_salv_table   = gr_table
    changing
      t_table        = it_out.

gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).

  gr_display = gr_table->get_display_settings( ).
  gr_display->set_striped_pattern( cl_salv_display_settings=>true ).
  gr_display->set_list_header( 'Cash Receipts Log' ).

  gr_sorts = gr_table->get_sorts( ).
*  TRY.

  call method gr_sorts->add_sort
  exporting
    columnname = 'BUKRS'
*      position   =
*      sequence   = IF_SALV_C_SORT=>SORT_UP
    subtotal   = if_salv_c_bool_sap=>false
*      group      = IF_SALV_C_SORT=>GROUP_NONE
*      obligatory = IF_SALV_C_BOOL_SAP=>FALSE
*    receiving
*      value      =
    .

  call method gr_sorts->add_sort
  exporting
    columnname = 'GKONT'
*      position   =
*      sequence   = IF_SALV_C_SORT=>SORT_UP
    subtotal   = if_salv_c_bool_sap=>false
*      group      = IF_SALV_C_SORT=>GROUP_NONE
*      obligatory = IF_SALV_C_BOOL_SAP=>FALSE
*    receiving
*      value      =
    .

  call method gr_sorts->add_sort
  exporting
    columnname = 'XREF1'
*      position   =
*      sequence   = IF_SALV_C_SORT=>SORT_UP
    subtotal   = if_salv_c_bool_sap=>false
*      group      = IF_SALV_C_SORT=>GROUP_NONE
*      obligatory = IF_SALV_C_BOOL_SAP=>FALSE
*    receiving
*      value      =
    .

  call method gr_sorts->add_sort
  exporting
    columnname = 'ZUONR'
*      position   =
*      sequence   = IF_SALV_C_SORT=>SORT_UP
    subtotal   = if_salv_c_bool_sap=>false
*      group      = IF_SALV_C_SORT=>GROUP_NONE
*      obligatory = IF_SALV_C_BOOL_SAP=>FALSE
*    receiving
*      value      =
    .

  call method gr_sorts->add_sort
  exporting
    columnname = 'BUDAT'
*      position   =
*      sequence   = IF_SALV_C_SORT=>SORT_UP
    subtotal   = if_salv_c_bool_sap=>true
*      group      = IF_SALV_C_SORT=>GROUP_NONE
*      obligatory = IF_SALV_C_BOOL_SAP=>FALSE
*    receiving
*      value      =
    .


  gr_columns = gr_table->get_columns( ).
  gr_column ?= gr_columns->get_column( 'GKONT').
  gr_column->set_long_text( 'Account Assignment Number' ).
  gr_column->set_medium_text( 'Account Assignment' ).
  gr_column->set_short_text( 'Account #' ).


  gr_agg = gr_table->get_aggregations( ).
  gr_agg->add_aggregation( 'WRBTR' ).

* Display
  gr_table->display( ).

Regards,

Davis