05-13-2010 12:31 PM
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.
05-13-2010 12:50 PM
Which one are you using on the selection screen to select the layout..
Radio Buttons..? Chcek Boxes..?
05-13-2010 12:51 PM
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.
05-13-2010 2:05 PM
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
05-13-2010 2:13 PM
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.