Application Development and Automation 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: 
Read only

how to save layout in normal alv report?

Former Member
0 Likes
11,696

Hi experts ,

I developed one report using ALV.In ALV after getting the o/p i want to save the layout.

But layout is not activated .(settings->layout->savings) In standard repors this option is there.

In normal ALV is it possible ? If so pls give the solution .

I serached in sdn also.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,191

Hi,

You have to use the parameter "IS_VARIANT" to enable save :

DATA: ls_variant TYPE  disvariant.
 
ls_variant-report = sy-repid.
ls_variant-username = sy-uname.
 
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program = sy-repid
    i_save = 'A'                ----------------------> *A for User-Specific and X for Global*
    it_fieldcat = lt_fieldcat
    is_variant = ls_variant
  TABLES
    t_outtab           = lt_tab
  EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.

VARIANT has the program's name in the REPORT field.

For your reference:

http://help.sap.com/saphelp_wp/helpdata/en/82/839d37664e4d45e10000009b38f8cf/content.htm

May it helps you.

Regards.

DS

Hi experts ,

I developed one report using ALV.In ALV after getting the o/p i want to save the layout.

But layout is not activated .(settings->layout->savings) In standard repors this option is there.

In normal ALV is it possible ? If so pls give the solution .

I serached in sdn also.

6 REPLIES 6
Read only

Former Member
0 Likes
7,191

Hi,

Are you using FM REUSE_ALV_GRID_DISPLAY? If yes, then pass 'X' to the parameter I_SAVE while calling the fm.

if you are using Object Oriented ALV, then call the below method before calling the method for display


DATA : gr_layout TYPE REF TO cl_salv_layout,
       gr_layout_key TYPE salv_s_layout_key.

CALL METHOD gr_functions->set_all
  EXPORTING
    value  = IF_SALV_C_BOOL_SAP=>TRUE.

  MOVE sy-repid TO gr_layout_key-report.

  CALL METHOD gr_table->get_layout
    RECEIVING
      value = gr_layout.

  CALL METHOD gr_layout->set_key
    EXPORTING
      value = gr_layout_key.

  CALL METHOD gr_layout->set_save_restriction
    EXPORTING
      value = if_salv_c_layout=>restrict_none.

  CALL METHOD gr_layout->set_default
    EXPORTING
      value = if_salv_c_bool_sap=>true.

Regards

Vinod

Edited by: Vinod Kumar on Jul 2, 2010 3:40 PM

Edited by: Vinod Kumar on Jul 2, 2010 4:43 PM

Read only

Former Member
0 Likes
7,191

hi,

in reuse_alv_grid_display FM you have a parameter I_save

DATA: ls_variant TYPE disvariant.

ls_variant-report = sy-repid.

ls_variant-username = sy-uname.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

i_save = 'X'

it_fieldcat = lt_fieldcat

is_variant = ls_variant

TABLES

t_outtab = lt_tab

EXCEPTIONS

program_error = 1

OTHERS = 2.

i_save = 'X' Global Saving

'U' User-specific saving

'A' corresponds to 'X' and 'U'

space no saving

please do search in the sdn before you post the query..you will find lot of answers.

regards,

nazeer

Read only

Former Member
0 Likes
7,192

Hi,

You have to use the parameter "IS_VARIANT" to enable save :

DATA: ls_variant TYPE  disvariant.
 
ls_variant-report = sy-repid.
ls_variant-username = sy-uname.
 
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program = sy-repid
    i_save = 'A'                ----------------------> *A for User-Specific and X for Global*
    it_fieldcat = lt_fieldcat
    is_variant = ls_variant
  TABLES
    t_outtab           = lt_tab
  EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.

VARIANT has the program's name in the REPORT field.

For your reference:

http://help.sap.com/saphelp_wp/helpdata/en/82/839d37664e4d45e10000009b38f8cf/content.htm

May it helps you.

Regards.

DS

Read only

Noorie
Active Participant
0 Likes
7,191

Hi,

yes, it is possible to activate layout.

Read only

Former Member
0 Likes
7,191

Hi experts,

problem is solved

Thank u for all.

Read only

Former Member
0 Likes
7,191

problem solved