DATA G_VARIANT LIKE DISVARIANT.
PARAMETERS P_VAR LIKE DISVARIANT-VARIANT.
INITIALIZATION.
G_VARIANT-REPORT = SY-REPID.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = G_VARIANT
I_SAVE = 'A'
IMPORTING
ES_VARIANT = G_VARIANT
EXCEPTIONS
NOT_FOUND = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC = 0.
P_VAR = G_VARIANT-VARIANT.
ELSE.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
In your FM REUSE_ALV_GRID_DISPLAY, pass G_VARIANT to the parameter IS_VARIANT of the FM.
Comments
Post a Comment