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

Select Option Validation

Former Member
0 Likes
779

Hi,

I have one Select-Option validation to do!

I have decalred on select-option as

<b>S_AUART FOR VBAK-AUART.</b>

Now for the above i have to do validation as:

I have to allow only display of <b>ZB1, ZB2, ZB3</b> <b>AUART</b> values. Else i have to give error.

How can i do it!

Thanks in advance.

Thanks & Regards,

Prasad.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
692

at selection-screen.

if S_AUART[] is initial.

message e000(msgclass) with 'Order type is empty'.

exit.

else.

loop at s_auart.

if s_auart-low <> 'ZB1' and

s_auart-low <> ZB2 and

s_auart-low <> ZB3.

message e000(msgclass) with 'Invalid Order type entered'.

exit.

endif.

endloop.

but you should use NO EXTENSIONS & NO INTERVALS addition in the select option definition. why because,

if you allow user to enter in both the LOW & HIGH fields of that select-option, we cant validate the values as per your requirements. for example, if user enters ZB1 in low field and ZX1 in HIGH field, its allowed values .but to vallidte it would be a problem.

so if you restrict the user to enter multiple single values like ZB1,ZB2,ZB3,ZX1 etc.. we can validate it with the above given logic,

check this & revert, if you need any further help.

endif.

added some comments

Message was edited by: Srikanth Kidambi

5 REPLIES 5
Read only

Former Member
0 Likes
693

at selection-screen.

if S_AUART[] is initial.

message e000(msgclass) with 'Order type is empty'.

exit.

else.

loop at s_auart.

if s_auart-low <> 'ZB1' and

s_auart-low <> ZB2 and

s_auart-low <> ZB3.

message e000(msgclass) with 'Invalid Order type entered'.

exit.

endif.

endloop.

but you should use NO EXTENSIONS & NO INTERVALS addition in the select option definition. why because,

if you allow user to enter in both the LOW & HIGH fields of that select-option, we cant validate the values as per your requirements. for example, if user enters ZB1 in low field and ZX1 in HIGH field, its allowed values .but to vallidte it would be a problem.

so if you restrict the user to enter multiple single values like ZB1,ZB2,ZB3,ZX1 etc.. we can validate it with the above given logic,

check this & revert, if you need any further help.

endif.

added some comments

Message was edited by: Srikanth Kidambi

Read only

naimesh_patel
Active Contributor
0 Likes
692

Hello,

Fill one range

ranges: r_auart for VBAK-AUART.

and add your values with

IBT ZB1

IBT ZB2

IBT ZB3

And in your

at selection-screen on s_auart.

loop at s_auart.

if not s_auart-low in r_auart.

*message

endif.

if not s_auart-high in r_auart.

*message

endif.

endloop.

regards,

Naimesh

Read only

0 Likes
692

Look at the function module 'SELECT_OPTIONS_RESTRICT'. There is very good documentation associated with it.

Here is an example using this function module where I restrict the users to just multiple single values for a select option called S_EXWRK which is for plant.

Read only

Former Member
0 Likes
692

Prasad,

You can do validations at many points.

1. You can provide a f4 help and display only values of your choice.

2. You can use ranges statement.

3. At start-of-selection, you can make the necessary validations by checking the user entry against your choice.

All the above options would help your need.

Revert back for any further clarificaitons.

Reward points if helpful

Read only

Former Member
0 Likes
692

hi,

AT SELECTION-SCREEN ON S_AUART.

IF S_AUART <> 'ZB1' OR

S_AUART <> 'ZB2' OR

S_AUART <> 'ZB3'.

MESSAGE E121(ZXXX).

ENDIF.

check it out,

regards,

kcc