‎2009 Jan 20 8:36 AM
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
‎2009 Jan 20 8:41 AM
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....
‎2009 Jan 20 8:38 AM
‎2009 Jan 20 8:41 AM
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....
‎2009 Jan 20 8:41 AM
You use at selection-screen event.
in event do required validations on fileds and display error message accordingly.
‎2009 Jan 20 8:42 AM
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.
‎2009 Jan 20 8:44 AM
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