Skip to Content
author's profile photo Former Member
Former Member

How to default values on screen using FREE_SELECTIONS_INIT

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.