Skip to Content
avatar image
Former Member

save layout Button in Object Oriented ALV

Hi gurus,

I am working on Object Oriented ALV. I am facing one problem when the outpput get shown on the screen the save layout and select layout buttons are not appearing on the application toolbar of alv.


cl_salv_table=>factory( IMPORTING r_salv_table = g_alv_out

CHANGING t_table = i_alv ).

  • Set status GUI


pfstatus = 'STANDARD'

report = sy-repid

set_functions = g_alv_out->C_FUNCTIONS_ALL ).

g_columns = g_alv_out->get_columns( ).

  • Set new description texts for columns

PERFORM f_set_column_name USING:

'LTEXT' text-001 text-001 text-001 space,

'NAME1' text-002 text-002 text-002 space,

'TXZ01' text-003 text-007 text-007 space,

'KWERT' text-004 text-004 text-004 space,

'WEMNG' text-005 text-010 text-011 space,

'BALNC' text-012 text-013 text-014 space,

'AFNAM' text-006 text-008 text-009 space.

PERFORM f_set_column_name USING 'WEMNG'

space space space 'WAERS'.

PERFORM f_set_column_name USING 'KWERT'

space space space 'WAERS'.

  • Set column as hotspot

g_column ?= g_columns->get_column( 'EBELN' ).

g_column->set_cell_type( g_column->hotspot ).

g_events = g_alv_out->get_event( ).

CREATE OBJECT gr_events .

SET HANDLER gr_events->on_double_click FOR g_events.

  • Display report

g_alv_out->display( ).

CATCH cx_salv_msg.


where in the Status STANDARD I have entered all the buttons includeing these two buttons

Can you please Help me in solving this issue.



Edited by: vinod parhad on Jul 2, 2010 1:35 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 02, 2010 at 11:44 AM
    data: gr_layout  type ref to cl_salv_layout,
    gr_alv     type ref to cl_salv_table,
     gs_key     type salv_s_layout_key,
    * in your SALV routine.... after FACTORY call
    gs_key-report = sy-repid.
    * User can save layout.
      gr_layout  = gr_alv->get_layout( ). "layouts
      gr_layout->set_key( gs_key ).  "Pass Program Name
      gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ). "User can save

    See also Rich Heilman's excellent tutorials on SALV by searching for SALV Tutorial,

    See also programs named: SALV* for demonstrations of SALV outputs and how to code.

    Edited by: BreakPoint on Jul 2, 2010 1:46 PM add references for tutorials

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 02, 2010 at 11:49 AM

    Check the demo program SALV_DEMO_TABLE_LAYOUT.

    Add comment
    10|10000 characters needed characters exceeded