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

Displaying error message

Former Member
0 Likes
1,954

Hi all,

I want to display an error message as and when an user enters an invalid value and for this I have written the following code:

at selection-screen.

if not s_name is initial.

select single name

from Ztest

into w_name

where merchantname eq s_name.

if sy-subrc NE 0.

message i061(zfi001) with text-005.

now the problem is when I am executing this report and if I enters the invalid name then it's taking a long time to display the message, can you please tell me what may be the possible problem.

Thanks,

Rajeev

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,230

Is s_name a select-option or a parameter?

5 REPLIES 5
Read only

Former Member
0 Likes
1,231

Is s_name a select-option or a parameter?

Read only

0 Likes
1,230

It's a selection option.

Thanks,

Rajeev

Read only

0 Likes
1,230

As it is a select option you should code like this:

at selection-screen.

if not s_name[] is initial.

select single name

from Ztest

into w_name

where merchantname in s_name.

if sy-subrc NE 0.

message i061(zfi001) with text-005.

endif.

Read only

0 Likes
1,230

Beside you check the type of parameters, would be better if you change the type of message for "E".

regards,

Alexandre

Read only

Former Member
0 Likes
1,230

try like this,

select single name

from Ztest

into w_name

where merchantname in s_name

Edited by: Rengith Skariah on Apr 17, 2008 3:37 PM