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

Save variant

Former Member
0 Likes
688

Hello !

I have developed a ALV report, and included the icon ICON_ALV_VARIANTS with function code &OL0. With this icon, the user can change the way it see the report, hide columns or show other ones. But the report doesn't show the option to save that variant, so the user can load in a easy way later.

What do I have to do, so the user can save his variant.

Thanks,

Javier

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

at selection-screen on value-request for p_vari.

**-- Display all existing variants

call function 'REUSE_ALV_VARIANT_F4'

exporting

is_variant = g_variant

i_save = g_save

importing

e_exit = g_exit

es_variant = gx_variant

exceptions

not_found = 2.

if sy-subrc = 2.

message id sy-msgid type 'S' number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

else.

if g_exit = space.

p_vari = gx_variant-variant.

endif.

endif.

Check out these sample program for illustration of above FM

http://www.sap-img.com/abap/alv-reporting-z-list-materials.htm

http://www.sap-img.com/abap/what-is-alv-programming.htm

Thanks

Seshu

3 REPLIES 3
Read only

Former Member
0 Likes
618

at selection-screen on value-request for p_vari.

**-- Display all existing variants

call function 'REUSE_ALV_VARIANT_F4'

exporting

is_variant = g_variant

i_save = g_save

importing

e_exit = g_exit

es_variant = gx_variant

exceptions

not_found = 2.

if sy-subrc = 2.

message id sy-msgid type 'S' number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

else.

if g_exit = space.

p_vari = gx_variant-variant.

endif.

endif.

Check out these sample program for illustration of above FM

http://www.sap-img.com/abap/alv-reporting-z-list-materials.htm

http://www.sap-img.com/abap/what-is-alv-programming.htm

Thanks

Seshu

Read only

Former Member
0 Likes
617

Hi,

You have the following EXPORTING parameters in my function module:

I_DEFAULT = 'X'

I_SAVE = 'A' "<=== this is to be global & user IS_VARIANT = VARIANT

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

The "user-specific saving" needs a special authorization: 
Authority-check object 'S_ALV_LAYO' id 'ACTVT' field '23', you can 
avoid this authorization with IS_LAYOUT-NO_AUTHOR = 'X'.

Regards

Sudheer

Read only

Former Member
0 Likes
617

Hello Javier,

This functionality is already existing with ALV.

In the application toll bar you can these three butoon for this option.

There is no need to implement new codes for this.

Vasanth