Application Development 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: 

Layout default option on the selection screen

Former Member
0 Kudos

I have given a Select Layout box on the Selection screen of my ALV report. How can I pass the default layout value, already set in the report to the box on the selection screen as the default value.

4 REPLIES 4

UdayS
Participant
0 Kudos

Which one are you using on the selection screen to select the layout..

Radio Buttons..? Chcek Boxes..?

Former Member
0 Kudos

DATA: RS_VARIANT LIKE DISVARIANT.

SELECTION-SCREEN : BEGIN OF BLOCK B10 WITH FRAME TITLE TEXT-024.
    PARAMETERS       : PA_VARI  TYPE SLIS_VARI.
SELECTION-SCREEN : END OF BLOCK B10.

FORM ALV_VARIANT_F4  CHANGING P_PA_VARI.
  DATA: "RS_VARIANT LIKE DISVARIANT,
         NOF4       TYPE C,
         G_REPID    TYPE SY-REPID.
  MOVE SY-REPID TO G_REPID.
  CLEAR NOF4.

  LOOP AT SCREEN.
    IF SCREEN-NAME    = PA_VARI.
      IF SCREEN-INPUT = 0.
        NOF4 = 'X'.
      ENDIF.
    ENDIF.
  ENDLOOP.

  RS_VARIANT-REPORT   = G_REPID.
  RS_VARIANT-USERNAME = SY-UNAME.

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      IS_VARIANT = RS_VARIANT
      I_SAVE     = 'A'
    IMPORTING
      ES_VARIANT = RS_VARIANT
    EXCEPTIONS
      OTHERS     = 1.

  IF SY-SUBRC = 0 AND NOF4 EQ SPACE.
    PA_VARI = RS_VARIANT-VARIANT.
  ENDIF.
ENDFORM.                    " ALV_VARIANT_F4

Following code is used to get the Layout selection box on the selection screen.

Former Member
0 Kudos

Hi goenkavishal ,

Would you like to place some value in the parameter by default...?

Ex : when you execute it..in the Parameter it should display some value like 'ABCD' or '0567'...?

PARAMETERS: p_curr(16) TYPE p DECIMALS 2 DEFAULT '123456.78.

Kindly let me know if this is not your requirement...

Regards,

Kittu

0 Kudos

Thanks for your prompt reply. But my requirement is slightly different.

I want the default layout option set in the report to come by default in the layout selection box on the Selection Screen.

Means whenever user runs the TCODE he wouldn't have to choose any layout. It will display in the default layout, if the user doesn't makes any selection.