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

Validation

Former Member
0 Likes
731

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
712

Hello Murali,

I believe this is possible using fixed values in a domain.

5 REPLIES 5
Read only

Former Member
0 Likes
712

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

Read only

Former Member
0 Likes
712

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.

Read only

Former Member
0 Likes
712

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

Read only

Former Member
0 Likes
713

Hello Murali,

I believe this is possible using fixed values in a domain.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
712

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.