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

loop

i am using this code but i dont get any values in wa_bkpf.

due to this sy-subrc is always 4.

but there is data in t_bkpf as waell as t_final

LOOP AT t_final INTO wa_final.

READ TABLE t_bkpf INTO wa_bkpf WITH KEY bukrs = wa_final-bukrs

belnr = wa_final-belnr

gjahr = wa_final-gjahr binar

IF sy-subrc = 0.

wa_final-awkey = wa_bkpf-awkey.

MODIFY t_final FROM wa_final.

ENDIF.

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 Apr 30, 2008 at 09:11 AM

    hi, put break point in this statement and check

    if these conditions matching or not.

    bukrs = wa_final-bukrs

    belnr = wa_final-belnr

    gjahr = wa_final-gjahr binar

    READ TABLE t_bkpf INTO wa_bkpf WITH KEY bukrs = wa_final-bukrs

    belnr = wa_final-belnr

    gjahr = wa_final-gjahr binar

    reward if useful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 09:14 AM

    Hi,

    when ever you use Binary Search, Sort the internal table first.

    sort t_bkpf by bukrs belnr gjahr.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 09:14 AM

    chk this:

    There may be recorsd in both the internal tables, but do u have matching records?

    LOOP AT t_final INTO wa_final.

    READ TABLE t_bkpf INTO wa_bkpf WITH KEY bukrs = wa_final-bukrs

    belnr = wa_final-belnr

    gjahr = wa_final-gjahr.

    IF sy-subrc = 0.

    wa_final-awkey = wa_bkpf-awkey.

    MODIFY t_final FROM wa_final.

    ENDIF.

    regards,

    madhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 09:16 AM

    use sort statement before read as below.

    sort t_bkpf by bukrs

    belnr

    gjahr.

    LOOP AT t_final INTO wa_final.

    READ TABLE t_bkpf INTO wa_bkpf WITH KEY bukrs = wa_final-bukrs

    belnr = wa_final-belnr

    gjahr = wa_final-gjahr binar

    IF sy-subrc = 0.

    wa_final-awkey = wa_bkpf-awkey.

    MODIFY t_final FROM wa_final.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 10:21 AM

    condition is not matching ....put there breakpoint and debug ur program ...your problem will solved

    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.