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: 

Regarding dates and selection screen

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

hi,

try using the events at selection-screen, at selection-screen input

Former Member
0 Kudos
at selection-screen.

if not date1[] is initial and
   not date2[] is initial.
  
   message e001(ZZ) with 'please enter only one date'.

endif.

0 Kudos

I got it but i need to clear all the fields in the selection screen after displaying the message.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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 ......

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Problem solved