‎2008 Dec 02 12:51 PM
hi.
i want to throw thw error message if the user enters the value not valid(not in the range) for the zregion1 of zbwcntry of the select options.
and user should be able to correct it before moving ahead.
Also,iis not a mandatory field,So if it is initial,it can b blank.
but if the input doesnot lie in the range,it should give error message on the selction screen.
please guid with the line of codes.
‎2008 Dec 02 12:55 PM
AT SELECTION-SCREEN.
IF s_...[] IS NOT INITIAL.
SELECT COUNT( * ) FROM ... WHERE field IN s_...
IF sy-subrc NE 0.
==> issue error message, that entered values are wrong
ENDIF.
ENDIF.
‎2008 Dec 02 1:07 PM
Check out this code:
TABLES: PERNR.
SELECT-OPTIONS VO_PERNR FOR PERNR-PERNR.
AT SELECTION-SCREEN ON VO_PERNR.
IF VO_PERNR IS INITIAL.
MESSAGE 'Enter some employee IDs' TYPE 'E' DISPLAY LIKE 'S'.
ELSE.
IF '000001' NOT IN VO_PERNR.
MESSAGE 'Employee id: 1, not selected' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
ENDIF.