‎2009 Jun 08 5:42 PM
hy expert,
the module is MM,
i have a select option: sobkz for mseg-sobkz.
but i want to check that the value the user enter is only
'V', or
'W' or,
'E' or,
'K' or,
'M' or,
'Q' or.
how can i check that the sobkz is in those 6 value (or range of value)?
thank you.
‎2009 Jun 08 5:53 PM
This is a little tricky when checking a range of values, but for single values. You can just loop the select-option and check it in the AT SELECTION-SCREEN event.
AT selection-screen.
loop at sobkz.
if sobkz-sign = 'I'
and sobkz-option = 'EQ'
and ( sobkz-low ne 'V'
or sobkz-low ne 'W'
or sobkz-low ne 'E
or sobkz-low ne 'K'
or sobkz-low ne 'M'
or sobkz-low ne 'Q' ).
* Give message .
endif.
Endloop.Again, checking the range is tricky, cuz the user could enter 'A' for the low value and 'Z' for the high value, so how would you check it then, right?
Regards,
Rich Heilman
Edited by: Rich Heilman on Jun 8, 2009 12:54 PM
Edited by: Rich Heilman on Jun 8, 2009 12:58 PM
‎2009 Jun 08 5:49 PM
Please search in this forum with key word
SELECT_OPTIONS_RESTRICT
a®
‎2009 Jun 08 5:53 PM
This is a little tricky when checking a range of values, but for single values. You can just loop the select-option and check it in the AT SELECTION-SCREEN event.
AT selection-screen.
loop at sobkz.
if sobkz-sign = 'I'
and sobkz-option = 'EQ'
and ( sobkz-low ne 'V'
or sobkz-low ne 'W'
or sobkz-low ne 'E
or sobkz-low ne 'K'
or sobkz-low ne 'M'
or sobkz-low ne 'Q' ).
* Give message .
endif.
Endloop.Again, checking the range is tricky, cuz the user could enter 'A' for the low value and 'Z' for the high value, so how would you check it then, right?
Regards,
Rich Heilman
Edited by: Rich Heilman on Jun 8, 2009 12:54 PM
Edited by: Rich Heilman on Jun 8, 2009 12:58 PM
‎2009 Jun 08 5:55 PM
Any way you are referring mseg-sobkz then user will get values which you mentioned only..
Or
you can write your own logic to check entered value
SELECT-OPTIONS: sobkz FOR mseg-sobkz.
AT SELECTION-SCREEN ON sobkz.
"Here you check values
IF sobkz NE 'V' OR
sobkz NE 'W' OR
sobkz NE 'E' OR
sobkz NE 'K' OR
sobkz NE 'M' OR
sobkz NE 'Q' .
MESSAGE 'Enter valid value' TYPE 'S'.
LEAVE LIST-PROCESSING.
ENDIF.
‎2009 Jun 08 5:55 PM
Hi ,
try this way...
select option: sobkz for mseg-sobkz.
at selction-screen on sobkz.
loop at sobkz.
if sobkz-low eq 'V' or
sobkz-low eq 'W' or
sobkz-low eq 'E' or
sobkz-low eq 'K' or
sobkz-low eq 'M' or
sobkz-low eq 'Q' .
Else.
message 'Invalid Entry' type 'E'.
endif.
endloop.
Prabhudas
‎2009 Jun 09 5:51 AM
Hello Mr. Andre,
You can try below logic also
IF sobkz CA 'VWEKMQ'.
write your code further
ENDIF.
Have a Nice Day,
Regards,
Sujeet
‎2009 Jun 09 6:55 AM
Hi,
My suggestion is to create a Z domain with Values V,W,E,K,M,Q and attach that to a Z data element and use that instead of SOBKZ. in select options.
This will solve your problem.
Regards
Karthik D
‎2009 Jun 09 3:19 PM
‎2009 Jun 09 7:04 AM
Hi,
You can use AT SELECTION SCREEN event will be triggered when the focus is on any of the fields on the selection screen.
Else you can use AT SELECTION SCREEN ON FIELD which will be triggered only when the focus is on that particular field mentioned in field.
Hope this helps..
Regards,
Jayanth G
‎2009 Jun 09 8:48 AM
You should use check Table T148 of field SOBKZ for validation.
Check the code below...
tables: mseg,T148.
select-options: s_sobkz for mseg-sobkz.
start-of-selection.
select * from T148
where sobkz in s_sobkz.
if not ( T148-sobkz eq 'V' or
T148-sobkz eq 'W' or
T148-sobkz eq 'E' or
T148-sobkz eq 'K' or
T148-sobkz eq 'M' or
T148-sobkz eq 'Q' ).
Message E999(FG) with
'Please do not give-' T148-sobkz ' in your selection.'.
endif.
endselect.
***Write your remaining code here
‎2009 Jun 09 3:20 PM