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

READ statement

Former Member
0 Likes
753

how to read two values from same field?

how to represent following statement?

READ TABLE it_komv WITH KEY kschl = ('ZPRN' , 'ZPRV').

6 REPLIES 6
Read only

Former Member
0 Likes
712

Hi,

READ TABLE it_komv WITH KEY kschl = 'ZPRN' or kschl = 'ZPRV'.

Plzz reward points if it helps.

Read only

Former Member
0 Likes
712

With in single READ statement you can't read muptiple values....

instead you can use LOOP AT ...

LOOP AT it_komv WHERE kschl = 'ZPRN' OR kschl = 'ZPRV' .

-


-


ENDLOOP.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
712

Hi,

READ TABLE it_komv WITH KEY kschl = 'ZPRN' kschl = 'ZPRV'.

Read only

Former Member
0 Likes
712

Hi

You can use statement like this

READ TABLE it_komv WITH KEY kschl = 'ZPRN'

kschl = 'ZPRV'.

Regards

Shibin

Read only

Former Member
0 Likes
712

Hi Prachi,

Use READ TABLE it_komv WITH KEY kschl in('ZPRN' , 'ZPRV').

Rgds,

Pankaj

Read only

Former Member
0 Likes
712

Hi,

You can do as below :

Create a range.


data : gr_kschl for table-fieldname.

gr_kschl-sign = 'I'.
gr_kschl-option = 'EQ'.
gr_kschl-low = 'ZPRN'.
append gr_kschl.

gr_kschl-sign = 'I'.
gr_kschl-option = 'EQ'.
gr_kschl-low = 'ZPRV'.
append gr_kschl.


then read the table as below :

loop at it_komv.

read table gr_kschl with low = it_komv-kschl-low.

if sy-subrc eq 0.

"Your necessary coding.

endif.

endloop.

Thanks,

Sriram Ponna.