‎2008 May 14 3:07 PM
Hi ,
I have to read 2 line item of same invoice no
for eg.
IN_NO ! MAT ! AMT
XYZ ! MAT1 ! 125
XYZ ! MAT2 ! 325
In o/p its display only 325 for both line items
I used this statement for readiing..
loop at i_final
loop at i_itab1 where knumv = i_final-knumv.
move i_itab1-kwert to i_vbtab-comm .
clear i_itab1-kwert.
endloop.
endloop.
In debuging i have determine that both first line item
amt is coming in header line but while coming in body.
I become the second line item amt
Can any one help me
‎2008 May 14 3:09 PM
‎2008 May 14 3:10 PM
I guess my last suggestion would not be right.
So is i_final the table with the wrong input? How should it look at the end
Edited by: Ramiro Escamilla on May 14, 2008 9:20 AM
‎2008 May 14 3:29 PM
Hi ,
sorry
the code which i used for reading is like this,
loop at i_final
loop at i_itab1 where knumv = i_final-knumv.
move i_itab1-kwert to i_final-comm .
clear i_itab1-kwert.
endloop.
endloop.
‎2008 May 14 3:33 PM
You still are not MODIFYing the table if you intend to write it later
loop at i_final
loop at i_itab1 where knumv = i_final-knumv.
move i_itab1-kwert to i_final-comm .
* clear i_itab1-kwert. "<== No need for this at all
endloop.
endloop.
Additionally, you're moving to your primary loop table. Never going to see two for it unless you write to a 3rd table or
replace the CLEAR with a WRITE:/ .......
Edited by: Paul Chapman on May 14, 2008 10:35 AM
‎2008 May 14 3:34 PM
Is knumv the only common key between the two?
what about that MAT in itab1?
What is the structure of i_final?
If the only common key they have is knumv of course you will always get 325 with that logic, because you loop to the last row in itab1 and that is the last record to update the header line.
Post the structure of both tables and how should both look like at the end. Your first post doesn´t make to much sense
‎2008 May 14 3:29 PM
If you are writing output from i_vbtab, at some point you will need to APPEND information to it.