‎2006 Sep 27 5:55 PM
Hello,
I have a select-option for date and I need to add some functionality based on the selection date. Like if the date is below 07/07/2004 i need to add some functionality and if the date is above 07/07/2004 i need to add a different functionality. So when the user enters the date range how do i check on this date and write the functionality..
Thanks
Vicky
‎2006 Sep 27 6:15 PM
hi vicky,
try this.
select-options: date for ztable-date_field.
at selectionscreen output
if date-low --chk ur condition.
endif.
if date-high -- chk ur condition.
endif.
in select options - first text box value is date-low
similarly the other one is date-high.
hope u got an idea.
if hlped mark points
rgds
anver
‎2006 Sep 27 6:09 PM
This could get a little tricky with a select-option because of all of the possibilties. But if you just want to check that the low value is before of after 07/07/2004, then you can simply do this.
report zrich_0004.
select-options: s_datum for sy-datum no-extension.
start-of-selection.
read table s_datum index 1.
if s_Datum-low < '20040707'.
else.
endif.
Regards,
Rich Heilman
‎2006 Sep 27 6:15 PM
hi vicky,
try this.
select-options: date for ztable-date_field.
at selectionscreen output
if date-low --chk ur condition.
endif.
if date-high -- chk ur condition.
endif.
in select options - first text box value is date-low
similarly the other one is date-high.
hope u got an idea.
if hlped mark points
rgds
anver
‎2006 Sep 27 6:16 PM
Hi,
if you want to do validation
at selection-screen.
if s_date-low < 07/07/2004
message e000 with 'invalid date'.
endif.
start-of-selection
if s_date-low < 07/07/2004
perform fun1.
else
performs_fun
endif.
Regards
amole
‎2006 Sep 27 6:18 PM
Hi Vicky,
Your Question is not very much clear.
What is ur requirement...
Is it Select-Options Validation in selection screen
or displaying output after input
If its regarding validation then use the following logic.
Select-options: sdate for sy-cdate.
At-selection-screen on sdate-low.
If sdate < sy-datum.
message e044.
Write ur own logic...
endif.
At-selection-screen on sdate-high.
message e045.
write ur own logic.
endif.
Or if you ant to display ouput then do code like below.
start-of-selection.
if sdate-low < sy-datum.
write ur functionality.
else.
if sdate-high > sy-datum.
write ur functionality.
endif.
endif.
if helpful
then reward me points.
Regards
Manas Ranjan Panda.
‎2006 Sep 27 6:38 PM
hi,
try this..
data:begin of itab occurs 0,
budat like mkpf-budat,
end of itab.
select-options: s_date for sy-datum.
start-of-selection.
select budat from mkpf into table itab where budat in s_date.
loop at itab.
if itab-budat < '20040707'.
ur function
elseif itab-budat = '20040707'.
ur function
else.
ur function
endif.
endloop.