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: 

How to default values on screen using FREE_SELECTIONS_INIT

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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.

Former Member
0 Kudos

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