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

alv layout variant

Former Member
0 Likes
668

g_rep = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = sy-repid

i_save = c_u

IMPORTING

e_exit = g_exit

es_variant = g_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

IF sy-subrc EQ 0.

IF g_exit IS INITIAL.

g_rep-variant = g_variant-variant.

p_layout = g_variant-variant.

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

is it necessary to use g_rep =sy-repid?

if yes then why

thanks in advance

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
644

Hi,

We need to pass the program name to the FM 'REUSE_ALV_VARIANT_F4' as the variants are stored program wise. Also in ur code u have passed in the exporting parameter ' is_variant = sy-repid' where is should be

g_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = g_variant

i_save = c_u

IMPORTING

e_exit = g_exit

es_variant = g_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

Regards,

Nikhil

Hi,

We need to pass the program name to the FM 'REUSE_ALV_VARIANT_F4' as the variants are stored program wise. Also in ur code u have passed in the exporting parameter ' is_variant = sy-repid' where is should be

g_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = g_variant

i_save = c_u

IMPORTING

e_exit = g_exit

es_variant = g_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

Regards,

Nikhil

3 REPLIES 3
Read only

Former Member
0 Likes
645

Hi,

We need to pass the program name to the FM 'REUSE_ALV_VARIANT_F4' as the variants are stored program wise. Also in ur code u have passed in the exporting parameter ' is_variant = sy-repid' where is should be

g_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = g_variant

i_save = c_u

IMPORTING

e_exit = g_exit

es_variant = g_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

Regards,

Nikhil

Read only

Former Member
0 Likes
644

Hi,

While calling the Function Module, in parameter IS_VARIANT you have to pass different fields of Variant and not SY-REPID.

if you seee the structure of parameter IS_VARIANT, there is one field REPORT where you have to pass SY-REPID.

Something like this: g_var-report = sy-repid.

SY-REPID is the Current Report/Program Name, which is calling this function Module.

Read only

Former Member
0 Likes
644

Thanks a lot both Nikhil and ANURITA!

Your help is really appreciable.

Prem