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: 

Selction-Screen Query??

Former Member
0 Kudos

Hi..

I have a date field on my selection-screen.

And I want 2 things for it..

1) I want a default value of sy-datum - 30 days for that field.And to implement it I have done the following Coding:--

INITIALIZATION.

V_DATE = SY-DATUM - 30.

SELECT-OPTIONS: S_ERDAT FOR NAST-ERDAT DEFAULT V_DATE

But, the problem is that I am not getting the correct default value of the date .(It comes as 00.00.000)

Please help me sort out this issue.

2) I also want to restrict the "multiple entries possibility " for this field.

Please tell me what shall I do?

Thanks

5 REPLIES 5

Former Member
0 Kudos

Subash,

Do this ...

INITIALIZATION.

V_DATE = SY-DATUM - 30.

S_ERDAT-OPTION = 'EQ'.

S_ERDAT-SIGN = 'I'.

S_ERDAT-LOW = V_DATE.

APPEND S_ERDAT.

SELECT-OPTIONS: S_ERDAT FOR NAST-ERDAT NO-INTERVALS NO-EXTENSIONS.

Or you can do this as well

INITIALIZATION.

V_DATE = SY-DATUM - 30.

SELECT-OPTIONS: S_ERDAT FOR NAST-ERDAT NO-INTERVALS NO-EXTENSIONS DEFAULT V_DATE.

Regards,

Ravi

Note :Please mark the helpful answers

Message was edited by: Ravikumar Allampallam

0 Kudos

Hi Ravi..

Thanks

I tried both of them...

The first one works but not the second one..

Former Member
0 Kudos

Hi,

In order to restrict an select option for multiple entries even when u double click on the select option u can use the function module SELECT_OPTIONS_RESTRICT.

Former Member
0 Kudos

Hello Subhash,

For SELECT-OPTION you can specify default but this default normally is a literal because at runtime when u select a submit( if you happen to) it is transferred to the selection options table sel so early that no value can be assigned to the field g. System fields like SY-DATUM are an exception here because the system usually assigns values to them as soon as the report processing starts.

I think this is the reason it is not happening in your case.

Former Member
0 Kudos

1) In Initialization, either you can assingn SO-low by = or you can use write, but in both cases you'll have to append the to particular select option

2) To restrict Multiple entries , use this

so_date for sy-datum NO-EXTENSION.

NO-EXTENSION would barr the multiple entries.

see if that was useful.