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

condition 'or' on a read table

Former Member
0 Likes
442

you can put a condition or the key of a table read

example.

READ TABLE i_bsid ASSIGNING <f_bsid>

WITH KEY kunnr = <f_zppo>-kunrg

belnr = <f_zppo>-belnr

bldat = <f_zppo>-zpda_von.

this instruction with 'OR'

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
411

No !!! U Cant

instead some thing like this


READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY kunnr = <f_zppo>-kunrg.
if sy-subrc ne 0.
READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY belnr = <f_zppo>-belnr.
if sy-subrc ne 0.
READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY bldat = <f_zppo>-zpda_von.

you can put a condition or the key of a table read

example.

READ TABLE i_bsid ASSIGNING <f_bsid>

WITH KEY kunnr = <f_zppo>-kunrg

belnr = <f_zppo>-belnr

bldat = <f_zppo>-zpda_von.

this instruction with 'OR'

2 REPLIES 2
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
412

No !!! U Cant

instead some thing like this


READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY kunnr = <f_zppo>-kunrg.
if sy-subrc ne 0.
READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY belnr = <f_zppo>-belnr.
if sy-subrc ne 0.
READ TABLE i_bsid ASSIGNING <f_bsid>
WITH KEY bldat = <f_zppo>-zpda_von.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
411

or use

READ TABLE i_bsid ASSIGNING <f_bsid>

loop at i_zppo assigning <f_zppo>.

loop at i_bsid ASSIGNING <f_bsid>

where kunnr = <f_zppo>-kunrg

or belnr = <f_zppo>-belnr

or bldat = <f_zppo>-zpda_von.

endloop.

endloop.