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

Validate a Field with 4 values .

Former Member
0 Likes
561

in the validation of a field in the selction screen . .

How to validate a field . if the input for a field can have 4 inputs .. like A,B,C,D... without specifying Ranges ..

<b>if the values for the field are given in select-options . as A to D .. in the selection screen ... and u tell me what happens .in validatiing the field.....that is in events like AT SELECTION-SCREEN and AT SELECTION-SCREEN ON...</b>

please give me reply to [email protected] thnk in advance..

in the validation of a field in the selction screen . .

How to validate a field . if the input for a field can have 4 inputs .. like A,B,C,D... without specifying Ranges ..

<b>if the values for the field are given in select-options . as A to D .. in the selection screen ... and u tell me what happens .in validatiing the field.....that is in events like AT SELECTION-SCREEN and AT SELECTION-SCREEN ON...</b>

please give me reply to [email protected] thnk in advance..

2 REPLIES 2
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
484

Hi,

You can write your code for both LOW and HIGH as follows

AT SELECTION-SCREEN ON selcrit-low.

You can check here if the value is 'A'

AT SELECTION-SCREEN ON selcrit-high.

You can check here if the value is 'D'.

Alternatively you can check as follows:

If 'A' in selcrit AND 'B' in selcrit AND 'C' in selcrit AND 'D' in selcrit.

endif.

Regards,

Sesh

Read only

Former Member
0 Likes
484

Hi,

Check the code below:

AT SELECTION-SCREEN.

  • To validate the selection screen

PERFORM validate_selection_screen.

  • check_vendor .

CLEAR: gs_lfa1.

IF NOT pa_lifnr IS INITIAL.

SELECT lifnr

INTO gs_lfa1

UP TO 1 ROWS

FROM lfa1

WHERE lifnr EQ pa_lifnr.

ENDSELECT.

IF sy-subrc NE gc_zero_num.

MESSAGE i000. "Enter Valid Vendor Number

ENDIF.

ENDIF.

Regards

Kannaiah