Application Development and Automation 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: 
Read only

Select-option default values

Former Member
0 Likes
4,514

Hi,

I have date as select-option.

I am required to

default current date minus one day to current date .simply my select-option-low = sy-datum-1,

select-option-high = sy-datum should be defaulted.

How to do this...?

thanks

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
3,880

Try with


Initialization.
s_date-low = sy-datum - 1.

a®

11 REPLIES 11
Read only

Former Member
0 Likes
3,880

HI,

Please refer the code below:


tables: bsis.

select-options : so_date for bsis-budat.

at selection-screen output.

so_date-low = sy-datum-1.
so_date-high = sy-datum.
append so_date.

Thanks,

Sriram Ponna.

Read only

former_member194669
Active Contributor
0 Likes
3,881

Try with


Initialization.
s_date-low = sy-datum - 1.

a®

Read only

0 Likes
3,880

ARS, Sriram ...I already did that...date-low = sy-datum-1. But the date was not defaulting on the selection screen. I see blank values.

I can see the values for date-low in debugging...but I wanna see them on screen displayed (defaulted)

Read only

0 Likes
3,880

Hi,

I could see the date in the selection screen with code what i have used. Have u used append statement.?

Thanks,

Sriram Ponna.

Read only

0 Likes
3,880

hahahha...lol ...you are right...

I missed append and was thinking therez some other way...

thanks guys

Read only

0 Likes
3,880

by the way it's

"at selection-screen output" that worked like sriram mentioned.

My code was in "at selection-screen" and it did not work.

Read only

b_deterd2
Active Contributor
0 Likes
3,880

In the INITIALIZATION or LOAD-OF-PROGRAM event set the values of the select-option.

s_opt-low = ..

s_opt-high = ..

s_opt-sign = ..

s_opt-option -....

APPEND S_OPT.

This should work.

Bert

Read only

Former Member
0 Likes
3,880

Hi'

U cant do sy-datum-1,'coz SAP internally stores date as yyyymmdd.so if today is 16 th april 2008 it stores as 20080416,if u do sy-datum-1,it gives wrong date.So its better use Function module

Read only

Former Member
0 Likes
3,880

Hi,

select-options:s_date for sy-datum.

initialization.

s_date-low = sy-datum - 1.

s_date-high = sy-datum.

append s_date.

Read only

0 Likes
3,880

When u fille select options internal table u should always try to fill all the field values

and append i..e is s_dat-sign = ''. "Dont forget to fill this

s_dat-option = ''. "Dont forget to fill this

s_dat-low = '' .

s_dat-high = ''.

append s_dat.

Read only

Former Member
0 Likes
3,880

hi Alchemi ,

try this one.

Initialization.

s_date-low = sy-datum - 1.

s_date-high = sy-datum .

append s_date.

Hope this has solved your problem.

Thanks and regards,

Rajesh.