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

error message requirement

Former Member
0 Likes
728

hi to alll experts,

my requirement is when user enters some value in the selection screen field if the condition is not satisfied an error message should be displayed and control should get back to the selection screen to change the value and same should be done for four other fields in the selection screen how to do it

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
680

Hi...

2 ways...

1 )AT SELECTION-SCREEN. u can do the validation...and put MESSAGE E000(00) with text.

2) or in START-OF SELECTION ....do the validation..if not satisfies..

if field is not initial..

v_flg = 'X'.

MESSAGE S000(00) with text.

STOP.

endif.

CHECK v_flg <> 'X'.

do the rest of the coding....

5 REPLIES 5
Read only

Former Member
0 Likes
680

You need to use AT SELECTION-SCREEN event.

Regards,

Shailaja

Read only

Former Member
0 Likes
681

Hi...

2 ways...

1 )AT SELECTION-SCREEN. u can do the validation...and put MESSAGE E000(00) with text.

2) or in START-OF SELECTION ....do the validation..if not satisfies..

if field is not initial..

v_flg = 'X'.

MESSAGE S000(00) with text.

STOP.

endif.

CHECK v_flg <> 'X'.

do the rest of the coding....

Read only

Former Member
0 Likes
680

You use at selection-screen event.

in event do required validations on fileds and display error message accordingly.

Read only

Former Member
0 Likes
680

Hi,

Following example prg will help u.

REPORT ZRAJTESTING.

TABLES: zemploy.

PARAMETER: order TYPE zemploy-yorder,

order1 type zemploy-yorder.

AT SELECTION-SCREEN.

if order is INITIAL.

MESSAGE 'Please enter the value' TYPE 'E'.

endif.

IF order1 ne 0.

MESSAGE 'Please enter 0.' TYPE 'E'.

clear order1.

ENDIF.

Hope this will help u.

Thanks.

Read only

Former Member
0 Likes
680

Use at selection screen

use perform inside it on the field you want like the sample code below:

AT SELECTION-SCREEN.

*Validate Sales Organization.

AT SELECTION-SCREEN ON s_vkorg.

PERFORM vkorg_validate.

FORM vkorg_validate .

DATA: lv_vkorg TYPE vbak-vkorg.

SELECT SINGLE vkorg

FROM tvko

INTO lv_vkorg

WHERE vkorg EQ s_vkorg-low.

IF sy-subrc NE 0.

MESSAGE e100 DISPLAY LIKE 'I'. "Please enter valid Sales Organization.

similarly you can do for other fields too.

Hope it helps.

Regards,

Rahul