‎2006 Feb 01 12:08 PM
Hi all,
I have a select-option field on selection-screen.I need to validate it.This field may contains only values 'Z1','Z2' OR 'Z3'.If this field contains other than these values i need to display one message,and these values may be in low value of that field or in high.How can i do this validation.Please clarify?
‎2006 Feb 01 12:33 PM
Hello Murali,
I believe this is possible using fixed values in a domain.
‎2006 Feb 01 12:11 PM
a select option field creates an internal table with the same name. check it to validate
TABLES: spfli.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE spfli.
DATA: END OF itab.
SELECT-OPTIONS: s_id FOR spfli-carrid.
DATA: i_idline LIKE s_id-low.
START-OF-SELECTION.
LOOP AT s_id .
i_idline = s_id-low.
IF i_idline EQ 'AA'.
WRITE: ' AA entered in select options'.
ENDIF.
ENDLOOP.
END-OF-SELECTION.Message was edited by: Deepak K
‎2006 Feb 01 12:28 PM
HI
select-option s_opt ....
At selection-screen.
if ( not s_opt-low = 'Z1' and not s_opt-low = 'Z2' and not s_opt-low = 'Z3' ) and ( not s_opt-high = 'Z1' and not s_opt-high = 'Z2' and not s_opt-high = 'Z3' ).
Message e001(zer).
endif.
‎2006 Feb 01 12:32 PM
sample code.........
tables: mara.
select-options: s_input for mara-matnr.
ranges: r_matnr for mara-matnr,
r_matnr1 for mara-matnr.
at selection-screen on s_input.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = 'Z1'.
append r_matnr.
r_matnr-low = 'Z2'.
append r_matnr.
r_matnr-low = 'Z3'.
append r_matnr.
r_matnr1-sign = 'I'.
r_matnr1-option = 'EQ'.
r_matnr1-low = 'Z1'.
append r_matnr1.
r_matnr1-low = 'Z2'.
append r_matnr1.
r_matnr1-high = 'Z3'.
append r_matnr1.
if s_input-low in r_matnr and s_input-high in r_matnr1.
else.
message e000(zz).
endif.
Pls reward if it solves your probs
Thanks
Eswar
‎2006 Feb 01 12:33 PM
Hello Murali,
I believe this is possible using fixed values in a domain.
‎2006 Feb 01 1:01 PM
Hi,
Write the code in start-of-selection.Kindly reward points by clicking the star on the left of reply,if it helps.
start-of-selection.
loop at s_option.
if ( s_option-low ne 'Z1' or s_option-high ne 'Z1').
message i000 with 'Error'.
endif.
endloop.