cancel
Showing results for 
Search instead for 
Did you mean: 

select option for date pre populated

Former Member
0 Kudos

Hi,

i use the WD4A Components WDR_SELECT_OPTIONS to create select option with range.

This select option is for date field .Now i want the select option to be prepopulated with sy-datum once the view opens.

Kindly help

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Here is an eLearning that discusses defaulting of values into a Select-Option:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60474842-91ca-2b10-3390-d2fd30f3...

Answers (1)

Answers (1)

former_member40425
Contributor
0 Kudos

you need to add the following code before calling method

ADD_SELECTION_FIELD

FIELD-SYMBOLS: <tab> TYPE INDEX TABLE,
<struct> TYPE ANY,
<wa> TYPE ANY,
<option> TYPE char2,
<sign> TYPE char1,
<high> TYPE ANY,
<low> TYPE ANY,
<wa_values> TYPE ANY.
ASSIGN lt_range_table->* TO <tab>.
APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
<sign> = 'I'. "Default sign which you want to give
<option> = 'EQ'. "Default option you want to give
<low> = 'Low_value'."Default low value which you want to give (in your case it would be sy-datum)
<high>= 'High_value' "Default high value which you want to give (if you want high value also sy-datum) 

I hope it helps.

Regards,

Rohit