Application Development 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: 

Check whether a variable is in a select option or not?

Former Member
0 Kudos

Hi guru,

I have a variable called TPLNR and a selection option S_TPLNR. How do I check whether the TPLNR is in the range of the selection option S_TPLNR? Thanks!

Best regards,

Anthony

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

its based on your declartion of select-options

Ex:

select-options:s_tplnr for tplnr.

or

select-options:s_tplnr for tplnr no-extension.

then

loop at s_tplnr where low <= tplnr and high >= tplnr.

flag = 'X'.

exit.

endloop.

if flag = 'X'.

found

endif.

select-options:s_tplnr for tplnr no intervals.

then

read table s_tplnr with key low = tplnr transporting no fields.

if sy-subrc = 0.

Found

endif.

Former Member

if both of them are defined for same format.

like

data: gv_vbeln type vbeln.

select_options: s_vbeln for vbak-vbeln.

so both these match.

now.

you can put

if gv_vbeln in s_vbeln. "it will check for the value in select option range as you have defined in the screen 
endif.

0 Kudos

Soumya has a better answer

Former Member
0 Kudos

Thanks for your helps!