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

using CS in read

Former Member
0 Likes
8,055

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
Read only

Former Member
0 Likes
4,095

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
Read only

Former Member
0 Likes
4,096

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

Read only

0 Likes
4,095

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

Read only

Former Member
0 Likes
4,095

Hi,

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

Regards,

Mohaiyuddin

Read only

0 Likes
4,095

Hi,

you can do this way :

Loop at itab.

if not fld CS 'xxxxx'

delete the row .

continue.

endloop.

Regards,

Rajashree

Read only

0 Likes
4,095

Hi ,

you can do this way :

Loop at itab.

if not fld CS 'xxxxx'

Do the reqd processing..

endloop.

Regards,

Rajashree

Read only

0 Likes
4,095

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 + *