‎2006 Aug 04 9:14 AM
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.
‎2006 Aug 04 9:18 AM
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
‎2006 Aug 04 9:18 AM
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
‎2006 Aug 04 9:20 AM
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
‎2006 Aug 04 9:20 AM
‎2006 Aug 04 10:02 AM
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
‎2006 Aug 04 12:16 PM
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