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

Layout default option on the selection screen

Former Member
0 Likes
2,117

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.

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
Read only

UdayS
Participant
0 Likes
1,143

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

Radio Buttons..? Chcek Boxes..?

Read only

Former Member
0 Likes
1,143

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.

Read only

Former Member
0 Likes
1,143

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

Read only

0 Likes
1,143

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.