How to set defulat varient in seleciton screen add layout in seleciton screen

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

Popular posts from this blog

all user exit mv45afzz (implicit user exit )

How to Give Dropdown in alv report in sap abap programming Language

Long Text in input and output field in module pool