09-10-2007 2:46 PM
Hi Experts,
I have the following requirement :
We have developed a screen on which there is a button. On click of the button, a dynamic selection screen is generated using the functions FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG.
I want when the selection screen is generated for the first time, the fields on it contains some default values taken from a table.
e.g. If Screen has fields MARA-MATNR, MARA-MTART, MARA-MEINS then MARA-MEINS should be defaulted with a value 'EA'.
I have tried a lot but could not find a solution to it.
Kindly help me out as this is very urgent.
Points are guaranteed..
Thanks in advance.
Regards,
Himanshu
09-10-2007 3:10 PM
SELCTION SCREEN
***********************************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK BLOCK_1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_RADLOC RADIOBUTTON GROUP GRP1 USER-COMMAND USER .
SELECTION-SCREEN BEGIN OF BLOCK SUB1_BLOCK WITH FRAME TITLE TEXT-002 NO INTERVALS.
PARAMETERS : P_LOCNO TYPE /SAPAPO/LOCNO MODIF ID ABC default 'Specify the default value here.
SELECTION-SCREEN END OF BLOCK SUB1_BLOCK.
SELECTION-SCREEN SKIP .
PARAMETERS : P_RADRES RADIOBUTTON GROUP GRP1 DEFAULT 'X'.
SELECTION-SCREEN BEGIN OF BLOCK SUB2_BLOCK WITH FRAME TITLE TEXT-003 NO INTERVALS.
PARAMETERS : P_RESNM TYPE /SAPAPO/RES_HEAD-NAME MODIF ID XYZ.
PARAMETERS : P_NOB TYPE /SAPAPO/CRES_NOINDIVRES MODIF ID XYZ.
SELECTION-SCREEN END OF BLOCK SUB2_BLOCK.
SELECTION-SCREEN END OF BLOCK BLOCK_1.
***********************************************************************************************
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_RADLOC = WL_SPACE .
IF SCREEN-GROUP1 = WL_ABC.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF P_RADRES = WL_SPACE .
IF SCREEN-GROUP1 = WL_XYZ.
CLEAR : P_RESNM, P_NOB.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ELSE.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
09-10-2007 3:15 PM
Hi,
When you press the BUTTON, there will be ok code for that one, and it will have the PBO also, in the PBO you can write the Default values to that screen.
or else, in the TOP include you can write teh EVENTS for that Selection screem that will work ...
Look at the demo progam
DEMO_SEL_SCREEN_AS_SUBSCREEN
Regards
Sudheer