2010 Jul 02 11:03 AM
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.
2010 Jul 02 12:04 PM
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.
2010 Jul 02 11:06 AM
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
2010 Jul 02 11:07 AM
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
2010 Jul 02 12:04 PM
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
2010 Jul 03 8:22 AM
2010 Jul 12 6:04 AM
2010 Jul 15 1:17 PM