‎2008 Apr 16 4:09 PM
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
‎2008 Apr 16 4:13 PM
‎2008 Apr 16 4:12 PM
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.
‎2008 Apr 16 4:13 PM
‎2008 Apr 16 4:17 PM
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)
‎2008 Apr 16 4:20 PM
Hi,
I could see the date in the selection screen with code what i have used. Have u used append statement.?
Thanks,
Sriram Ponna.
‎2008 Apr 16 4:24 PM
hahahha...lol ...you are right...
I missed append and was thinking therez some other way...
thanks guys
‎2008 Apr 16 4:33 PM
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.
‎2008 Apr 16 4:13 PM
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
‎2008 Apr 16 4:15 PM
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
‎2008 Apr 16 4:18 PM
Hi,
select-options:s_date for sy-datum.
initialization.
s_date-low = sy-datum - 1.
s_date-high = sy-datum.
append s_date.
‎2008 Apr 16 4:25 PM
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.
‎2008 Apr 16 4:44 PM
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.