‎2007 Mar 09 4:17 AM
Hi all,
In my selection screen i have 2 date fields(ranges). I have a requirement wherein i have to allow user to select only one date i.e. let the date fields be date1 and date2 when the user enters date1 he should not be allowed to enter date2 and when the user enters date2 then he should not be allowed to enter date1.
when user enters date1 and tries to enter date2 then a message should be displayed.
pls urgent requirement and points are gauranteed.
Regards,
Ravi
‎2007 Mar 09 4:19 AM
hi,
try using the events at selection-screen, at selection-screen input
‎2007 Mar 09 4:21 AM
at selection-screen.
if not date1[] is initial and
not date2[] is initial.
message e001(ZZ) with 'please enter only one date'.
endif.
‎2007 Mar 09 5:13 AM
I got it but i need to clear all the fields in the selection screen after displaying the message.
‎2007 Mar 09 6:11 AM
but why do u need that ? Anyhow chk this...
at selection-screen.
if not date1[] is initial and
not date2[] is initial.
<b> clear : field1 , field2 , date1[] .....</b>
message e001(ZZ) with 'please enter only one date'.
endif.
Reward for helpful answers
‎2007 Mar 09 4:35 AM
try this code
slect-options : sdate1 for mkpf-budat,
sdate2 for mkpf-budat.
parameters : rdate1 radiobutton group rb1 user-command date default 'X',
rdate1 radiobutton group rb1.
at selection-screen output.
if rdate1 = 'X'.
loop at screen.
if screen-name = sdate2-low or screen-name = sdate2-high.
screen-input = '0'.
modify screen.
elseif rdate2 = 'X'.
loop at screen.
if screen-name = sdate1-low or screen-name = sdate1-high.
screen-input = '0'.
modify screen.
endif.
at selection-screen.
if rdate1 = 'X'.
clear sdate2[].
elseif rdate2 = 'X'.
clear sdate1[].
endif.
START-OF-SELECTION.
regards
shiba dutta
‎2007 Mar 09 4:56 AM
Ravi kumar,
Ravi,
For this requirement after entered the date in any field ,some event should fire.For that you need to press some check boxes or radion button or need to execte.Just entering the date no event will get triggered.So plan accordingly if you want dynamic screen validation.If you are ready to put radio buttons for both dates.
Go through the Shiba duuta logic. Otherwise go through the chandrasekar logic
Pls. reward if matter id useful.
Thanks ......
‎2007 Mar 09 5:02 AM
at selection-screen.
if s_date1-low is not initial and s_date2-low is not initial.
message 'Enter onli one date' type 'E'.
endif.
start-of-selection.
-
Hope this helps u...
reward helpful answers...
sai ramesh.
‎2007 Mar 09 6:02 AM
Hi Ravi,
After displaying the message just refresh the appropriate range.
Ex : if you have filled up the values for date1 then use
<b>refresh date2.</b>
Thanks and regards,
Siva
‎2007 Mar 16 3:27 AM