Application Development and Automation 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: 
Read only

Parameter Validation

Former Member
0 Likes
717

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
683

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

5 REPLIES 5
Read only

Former Member
0 Likes
683

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.

Read only

Former Member
0 Likes
684

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

Read only

Former Member
0 Likes
683

Hi,

You can do this parameter validation in event

"at selection-screen."

Regards,

Krishnamurthy.SC

Read only

Former Member
0 Likes
683

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,

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
683

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.