Skip to Content
author's profile photo Former Member
Former Member

using CS in read

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 03:56 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2008 at 04:39 AM

    Hi,

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

    Regards,

    Mohaiyuddin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.