Skip to Content
0
Nov 12, 2012 at 09:00 PM

last item record is repeating in VBAP table for a particular VBAK-VBELN

90 Views

Hello , I hav a program for which i am displaying sales order items for a particular header record.

so when i am looping on vbak table and inside that loop , i made aanother loop to fetch itemwise records. at that time last record is repeating twice.what's the solution to overcome that....

this is the problamatic code ..

--------------------------------------

loop at t_vbak into w_vbak.

w_final-vbeln = w_vbak-vbeln.

w_final-erdat = w_vbak-erdat.

loop at t_vbap into w_vbap where vbeln = w-vbak-vbeln.

w_final-posnr = w_vbap-posnr.

w_final-matnr = w_vbap-matnr.

w_final-matkl = w_vbap-matkl.

append w_final to t_final.

endloop.

append w_final to t_final.

endloop.