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: 

Read an itab with read table but

Former Member
0 Kudos

Hi all,

I want to read an internal table with a criterion like;

read table xlips with key vbeln = xlips-vbeln matnr = xlips-matnr <b>charg ne space</b>.

Charg ne space is not allowed however I need it.

Is there any other way to do that?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Deniz

Please check if the addition COMPARING to READ TABLE is of any use...

Otherwise probably LOOP AT <> WHERE <> . ENDLOOP will have to be used

Regards

Arun

Message was edited by:

Arun Nair

7 REPLIES 7

former_member386202
Active Contributor
0 Kudos

Hi,

try like this

read table xlips with key vbeln = xlips-vbeln matnr = xlips-matnr .

if sy-subrc eq 0.

if xlips-charg ne space.

statement

endif

endif.

Regards,

Prashant

Former Member
0 Kudos

read table xlips into wa.

if ( wa-vbeln = xlips-vbeln ) and ( matnr = xlips-matnr ) and ( wa-charg ne space ).

buil logic succ

endif.

read table xlips into wa with keyvbeln wa-vbeln matnr xlip-matnr.

if sy-subrc = 0.

if wa-charg ne space .

buil logic succ

endif.

endif.

Former Member
0 Kudos

You can check the condition inside the read stmt..

If the read stmt succeeds it will go inside,there u can check with if cheng = space..

Reward if useful

Former Member
0 Kudos

Hi,

First check charg NE space.

if sy-subrc = 0.

read table xlips with key vbeln = xlips-vbeln matnr = xlips-matnr

endif.

Regards,

Vani

former_member404244
Active Contributor
0 Kudos

Hi deniz,

u cannot use NE symbol with read statement...

try like this

read table xlips with key vbeln = xlips-vbeln

matnr = xlips-matnr .

if sy-subrc eq 0.

if xlips-charg ne space.

here do wat u want.

endif

endif.

Regards,

Nagaraj

Former Member
0 Kudos

Hello Deniz

Please check if the addition COMPARING to READ TABLE is of any use...

Otherwise probably LOOP AT <> WHERE <> . ENDLOOP will have to be used

Regards

Arun

Message was edited by:

Arun Nair

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Otherway is to use loop.

loop at xlips where vbeln = xlips-vbeln and matnr = xlips-matnr and charg ne space.

...

endloop.