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

loop,read

rahul2000
Contributor
0 Likes
356

Dear all,

I am doing something like this

LOOP AT IT_RESB INTO WA_RESB.

READ TABLE IT_EBAN INTO WA_EBAN WITH KEY MATNR = WA_RESB-MATNR.

no resb has multiple entries of the same material.

so the read statment will pick up the first entry that it gets even though the same material if repeated thrice it has 3 different quantities.so my first quantity is repeated everywhere.

What other key can i use betewwn these two tables?

BANFN does not get updated in RESB,else problem would have been solved.plz tell me how to loop

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
335

Hi,

Use one more loop statement instead of READ.

LOOP AT IT_RESB INTO WA_RESB.

LOOP AT IT_EBAN INTO WA_EBAN WHERE MATNR = WA_RESB-MATNR.

(If u want to sum the quantity, do it. All the 3 qty records will be considered.)

sum = sum + wa_eban-qty.

ENDLOOP.

(do the required process with the summed qty)

ENDLOOP.

Edited by: Ramesh Hirial on Jan 10, 2008 3:17 PM

2 REPLIES 2
Read only

Former Member
0 Likes
336

Hi,

Use one more loop statement instead of READ.

LOOP AT IT_RESB INTO WA_RESB.

LOOP AT IT_EBAN INTO WA_EBAN WHERE MATNR = WA_RESB-MATNR.

(If u want to sum the quantity, do it. All the 3 qty records will be considered.)

sum = sum + wa_eban-qty.

ENDLOOP.

(do the required process with the summed qty)

ENDLOOP.

Edited by: Ramesh Hirial on Jan 10, 2008 3:17 PM

Read only

Former Member
0 Likes
335

Hi Rahul,

Try this.

After using this quantity before the Endloop statement Delete that record from the Internal table. Now each time u can get different quantity.

awrd points if helpful

Bhupal