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

checking the select option values present in Range table..

Former Member
0 Likes
2,878

Hi all,

I 've to check whether the values given in select option is present in a range table which i ve created.

i ve written like

IF SO_SURDT NOT IN R_RANGETAB.

3 REPLIES 3
Read only

former_member70391
Contributor
0 Likes
1,147

Hi,

REPORT ZTEST01.

tables: mara.

selection-screen begin of block b1.

select-options : s_matnr for mara-matnr.

selection-screen end of block b1.

ranges: r_matnr for mara-matnr.

r_matnr-low = '000000000060000010'.

r_matnr-high = '000000000060000011'.

r_matnr-option = 'BT'.

r_matnr-sign = 'I'.

append r_matnr.

if s_matnr[] eq r_matnr[].

write: 'Equal'.

else.

write: 'Not Equal'.

endif.

Thanks & Regards,

Nagaraj Kalbavi

Read only

Former Member
0 Likes
1,147

I ' ve written like

IF S_AURDT NOT IN RANGETAB.

message E000.

where rangetab contains fields low,high,sign,option.

how to check values in select option is present in rangetab or not.

when multiple vales for s_aurdt are given.

Read only

0 Likes
1,147

Hi Sunny,

If you write Like this then it will give syntax error. I used ur coding and system is throwing me error.

tables: mara.

selection-screen begin of block b1.

select-options : s_matnr for mara-matnr.

selection-screen end of block b1.

ranges: r_matnr for mara-matnr.

r_matnr-low = '000000000060000010'.

r_matnr-high = '000000000060000011'.

r_matnr-option = 'BT'.

r_matnr-sign = 'I'.

append r_matnr.

IF S_matnr[] NOT IN R_matnr[].

write: 'Not Equal'.

else.

write: 'Equal'.

endif.

Use The code what I Given before it will work.

tables: mara.

selection-screen begin of block b1.

select-options : s_matnr for mara-matnr.

selection-screen end of block b1.

ranges: r_matnr for mara-matnr.

r_matnr-low = '000000000060000010'.

r_matnr-high = '000000000060000011'.

r_matnr-option = 'BT'.

r_matnr-sign = 'I'.

append r_matnr.

IF S_matnr[] EQ R_matnr[].

write: 'Not Equal'.

else.

write: 'Equal'.

endif.

U can also use loop at s_matnr to check comapre one by one record in range tab but performance will be slow.

Hope it helps.

Thanks & Regards,

Nagaraj Kalbavi