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: 

How to give error message for the screen element text field when wrong i/p

Former Member
0 Kudos

How to give error message for the screen element text field when wrong i/p

when wrong input given

eg.

I have a text box with SBOOK-CARRID

so when user give wrong entry in text box i.e LG

then I should give some error stating that the the input is invalid or not available ,

now it showing the error of standard messages,

i want manual message to be displayed when error comes.

Thank you,

Regards,

Jagrut Bharatkumar Shukla

4 REPLIES 4

Former Member
0 Kudos

code like this :

at-selection-screen-output on <parameter>.

select single from sbook whrere carrid = <paramter>

if sy-subrc <> 0.

message e333(s1) with 'your custom message'.

endif.

reward points if helpful

former_member386202
Active Contributor
0 Kudos

Hi,

Try this.

REPORT zt0020

NO STANDARD PAGE HEADING

MESSAGE-ID sabapdocu.

If Field NE 'give condition '.

MESSAGE i888 WITH 'Input is invalid'.

LEAVE LIST-PROCESSING.

endif.

Regards,

Prashant

0 Kudos

Hi all,

Thank you for your valuable reply,

but the thing is that its a screen field,

i.e text box not a selection screen

i created in screen layout

with name sbook-carrid

,

now i want to get error message display if wrong i/p is given

thank you.

Regards,

Jagrut bharatkumar Shukla,

former_member404244
Active Contributor
0 Kudos

Hi,

write the logic in PAI of the screen.

select single carrid from sbook into v_carrid whrere carrid = <paramter>

if sy-subrc <> 0.

message e333 with 'your custom message'.

endif.

Regards,

Nagaraj