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: 

using CS in read

Former Member
0 Kudos

hi anyone can help and advise how i can use contain string coz below it doesn't work

do you think

may b i can concatenate wa_edmse-lfsnr + * in a variable

then read where that variable

loop i_edmsa into wa_edmse

read table i_nast into wa_nast

with key objky CS wa_edmse-lfsnr.

endloop

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In the READ TABLE statement, key fields are assigned values using '=' operator. Most people confuse '=' with the 'EQ' operator in the READ statement as this interchangeabilty is allowed in other statements like IF e.g.


IF something EQ something_else.

vs

IF something = something_else.

Both the above IF statements work correctly. But the same is not true with READ TABLE. You have to use '=' operator (instead of CS) as that is the operator for the assignment.

I think, you need to use a loop for i_nast with a where clause and then in the where clause you may use CS.

Hope this helps.

Thanks

Sanjeev

6 REPLIES 6

Former Member
0 Kudos

In the READ TABLE statement, key fields are assigned values using '=' operator. Most people confuse '=' with the 'EQ' operator in the READ statement as this interchangeabilty is allowed in other statements like IF e.g.


IF something EQ something_else.

vs

IF something = something_else.

Both the above IF statements work correctly. But the same is not true with READ TABLE. You have to use '=' operator (instead of CS) as that is the operator for the assignment.

I think, you need to use a loop for i_nast with a where clause and then in the where clause you may use CS.

Hope this helps.

Thanks

Sanjeev

0 Kudos

what if i do like that

SELECT objky datvr uhrvr

FROM nast

INTO TABLE i_nast

WHERE kappl EQ c_v2

AND vstat EQ c_1

AND kschl EQ lv_zzparm1.

IF sy-subrc EQ 0.

SORT i_nast BY objky.

LOOP AT i_EDMSE

CLEAR: wa_nast, lv_lfnr.

  • Search object key that contain delivery note

CONCATENATE wa_edmse-lfsnr c_ast INTO lv_lfnr.

READ TABLE i_nast INTO wa_nast

WITH KEY objky = lv_lfnr.

IF sy-subrc EQ 0.

  • exclude AAD print output that was processed after goods issue

IF wa_nast-datvr LT wa_edmse-budat.

CONTINUE.

ENDIF.

endloop

Former Member
0 Kudos

Hi,

I don't think read table can work with CS..

Regards,

Mohaiyuddin

0 Kudos

Hi,

you can do this way :

Loop at itab.

if not fld CS 'xxxxx'

delete the row .

continue.

endloop.

Regards,

Rajashree

0 Kudos

Hi ,

you can do this way :

Loop at itab.

if not fld CS 'xxxxx'

Do the reqd processing..

endloop.

Regards,

Rajashree

0 Kudos

CONCATENATE wa_edmse-lfsnr c_ast INTO lv_lfnr.

READ TABLE i_nast INTO wa_nast

WITH KEY objky = lv_lfnr.

Note that lv_lfnr = wa_edmse-lfsnr + *