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

error?

When i give the statement like

LOOP AT t_vbuk WHERE trsta = c_trsta_b.

l_count = sy-tabix.

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6 OR

tplst = c_tplst2 OR

tplst = c_tplst1 OR

tplst = c_tplst4 OR

tplst = c_tplst3 OR.

IF sy-subrc NE 0.

DELETE t_vbuk INDEX l_count.

ENDIF.

ENDLOOP.

Iam getting the error "Unable to interpt "TPLST".Possible causes of error.Incorrect comma or spelling error".Please give me suggestions.

Regards,

srihitha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 12:24 PM

    Hi

    Try this.

    LOOP AT t_vbuk WHERE trsta = c_trsta_b.

    l_count = sy-tabix.

    READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

    vbeln = t_vbuk-vbeln

    ( tplst = c_tplst6 OR

    tplst = c_tplst2 OR

    tplst = c_tplst1 OR

    tplst = c_tplst4 OR

    tplst = c_tplst3 ).

    IF sy-subrc NE 0.

    DELETE t_vbuk INDEX l_count.

    ENDIF.

    ENDLOOP.

    OR try below code.

    LOOP AT t_vbuk WHERE trsta = c_trsta_b.

    l_count = sy-tabix.

    loop at t_vttk_vttp INTO w_vttk_vttp where

    vbeln = t_vbuk-vbeln AND

    ( tplst = c_tplst6 OR

    tplst = c_tplst2 OR

    tplst = c_tplst1 OR

    tplst = c_tplst4 OR

    tplst = c_tplst3 ).

    IF sy-subrc NE 0.

    DELETE t_vbuk INDEX l_count.

    ENDIF.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2007 at 12:29 PM

    Hi,

    try Like this.

    LOOP AT t_vbuk WHERE trsta = c_trsta_b.

    l_count = sy-tabix.

    READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY vbeln = t_vbuk-vbeln

    tplst = c_tplst6 OR

    tplst = c_tplst2 OR

    tplst = c_tplst1 OR

    tplst = c_tplst4 OR

    tplst = c_tplst3.

    IF sy-subrc NE 0.

    DELETE t_vbuk INDEX l_count.

    ENDIF.

    ENDLOOP.

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 12:36 PM

    Same statement all are giving.There is no changes in the code.Please give me correct code.

    Regards,

    Srihith

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Srihitha,

      do like this

      Remove OR in read statement

      LOOP AT t_vbuk WHERE trsta = c_trsta_b.

      l_count = sy-tabix.

      READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY vbeln = t_vbuk-vbeln

      <b>tplst in ( c_tplst6,c_tplst2, c_tplst1,c_tplst4,c_tplst3).</b>

      IF sy-subrc NE 0.

      DELETE t_vbuk INDEX l_count.

      ENDIF.

      ENDLOOP.

      <b>Reward Points for helpful answers</b>

      Satish

      Message was edited by:

      Satish Panakala

  • Posted on Nov 23, 2007 at 01:05 PM

    hi,

    try using READ and IF.

    otherwise use,

    LOOP AT t_vttk_vttp INTO w_vttk_vttp where

    vbeln = t_vbuk-vbeln AND

    ( tplst = c_tplst6 OR

    tplst = c_tplst2 OR

    tplst = c_tplst1 OR

    tplst = c_tplst4 OR

    tplst = c_tplst3 ).

    exit.

    ENDLOOP.

    *it will come out of the loop once single record is taken.

    *it works same as read stmt does.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2007 at 01:14 PM

    hi,

    you cannot use AND, OR, IN, etc. with READ TABLE. You can only do:

    READ TABLE ...

    WITH KEY field1 = xxx

    field2 = yyy

    etc.

    what you can do here:

    LOOP.

    PERFORM read_table USING c_tplst6.

    IF sy-subrc ne 0.

    PERFORM read_table USING c_tplst2.

    IF sy-subrc ne 0.

    PERFORM read_table USING c_tplst1.

    etc.

    ENDIF.

    ENDIF.

    FORM read_table USING lv_tpl

    READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

    vbeln = t_vbuk-vbeln

    tplst = lv_tpl.

    ENDFORM.

    hope this helps

    ec

    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.