‎2006 Oct 10 6:38 AM
Hi,
I would like to validate two parameters in the selection screen at the same time. How can I perform it? I will explain in detail. There are two parameters: lvstartdt and lvenddate. I need to check a record (before going for further processing) in the table PA2001 for the dates given in lvstartdt and lvenddate. If there is no such record, I need to give an error message without exiting from the selection screen. Please help me..
Good solutions will be rewarded...
Best Regards
Renjan
‎2006 Oct 10 6:42 AM
Hi,
Use the "At selction screen" event.
eg.
At selection-screen.
select single *
from table
where date1 EQ lvstartdt
and date2 EQ lvenddate.
if sy-subrc NE 0.
message e001(msg_class).
enndif.
This should solve ur problem.
Regards...
‎2006 Oct 10 6:41 AM
you can do this at selection screen output
at selection-screen output
if not lv_startdt is initial.
*Do your validation here
if sy-subrc ne 0.
set cursor field 'LV_STARTDT'.
*error message
endif.
endif.
if not lv_enddt is initial.
*Do your validation here
if sy-subrc ne 0.
set cursor field 'LV_ENDDT'.
*error message
endif.
endif.
‎2006 Oct 10 6:42 AM
Hi,
Use the "At selction screen" event.
eg.
At selection-screen.
select single *
from table
where date1 EQ lvstartdt
and date2 EQ lvenddate.
if sy-subrc NE 0.
message e001(msg_class).
enndif.
This should solve ur problem.
Regards...
‎2006 Oct 10 6:46 AM
Hi,
You can do this parameter validation in event
"at selection-screen."
Regards,
Krishnamurthy.SC
‎2006 Oct 10 6:47 AM
AT Selection-screen output.
use ranges for building date
option BT sign I low lvstartdat high lvenddate
do your validation
select single col1 form pa2001 where dat in r_date,
‎2006 Oct 10 6:49 AM
Hi,
At selection-screen output.
if not ( lvstartdt is initial and lvenddate is initial ).
select * from pa2001 into table t_pa2001 up to 1 rows
where condition.
else.
message e000 with 'Enter valid date'.
leave list-processing.
endif.