I will be grateful for you for your help.
My requirement is I have to calculate all the amount with matching PO(ebeln) and PO line item(ebelp) and if the balance is less than Zero with matching PO and PO line item than I have to delete that record from itab or else if it is not zero than it should be in output.
My code what i have written it is working only by comparing PO(ebeln)
LOOP AT e_final INTO lwa_final.
IF e_final IS NOT INITIAL.
lv_sum = lv_sum + lwa_final-dmbtr.
At new ebeln. "po
At new ebelp. "po item
IF lv_sum LE 0.
DELETE e_final WHERE ebeln EQ lwa_final-ebeln.