Skip to Content
0
Former Member
Jul 17, 2008 at 11:35 AM

how to implement the logic in the code

17 Views

Hi,

i want to do sum for each and every line item of the delivery quantity and compare it with final purchase order quantity if it is equal do not display in the output.(how to use at last/at end of ) in this code,

********

below code wat i have ritten is only comparing first record quantity (not total line items quantity )with final purchase order quantity and displaying the output, but i want sum of each and every line item of the delivery quantity (total)and compare with final quantity(purchase order quantity) and which are greater than final purchase order quantity those wil be displayed in the output.

********

if possible try modify this code

clear:wa_final,wa_kopoo,wa_likpp1.

loop at it_kopoo into wa_kopoo.

move wa_kopoo-ebeln to wa_final-ebeln.

move wa_kopoo-ebelp to wa_final-ebelp.

move wa_kopoo-matnr to wa_final-matnr.

move wa_kopoo-txz01 to wa_final-txz01.

move wa_kopoo-menge to wa_final-menge.

move wa_kopoo-meins to wa_final-meins.

move wa_kopoo-werks to wa_final-werks.

move wa_kopoo-matkl to wa_final-matkl.

move wa_kopoo-reswk to wa_final-reswk.

move wa_kopoo-aedat to wa_final-aedat.

move wa_kopoo-ekgrp to wa_final-ekgrp.

move wa_kopoo-EINDT to wa_final-EINDT.

read table it_likpp1 into wa_likpp1 with key vgbel = wa_final-ebeln

vgpos = wa_final-ebelp.

if sy-subrc eq 0.

if wa_final-menge > wa_likpp1-LFIMG.

else.

continue.

endif.

endif.

append wa_final to it_final.

clear:wa_final,wa_kopoo,wa_likpp1.

endloop.

endif.

Thanks in Advance