‎2009 May 21 3:36 PM
Hello,
I have an internal table, like the EKBE table.
I want to create a table with the following format.
For each PO order (EBELN), for easch item (EBELP), for each po category (BEWTP), I want to sum the WRBTR and BPMNG. When the SHKZG is H the WRBTR and BPMNG must be negative for the sum.
The result is that we will have one line per PO's Item.
i attach and a photo of the ekbe table.
thanks.
[http://www.mypicx.com/uploadimg/989252154_05212009_1.bmp]
Edited by: stratos_chm on May 21, 2009 4:36 PM
‎2009 May 21 3:44 PM
HI,
The order of the field in the internal table should be
EBELN
EBELP
BEWTP
....
SORT ITAB BY EBELN EBELP BEWTP.
LOOP AT ITAB.
IF SHKZG EQ 'H'.
AMOUNT " SUBTRACTION
ELSE.
AMOUNT " ADDITON
ENDIF.
AT NEW BEWTP.
" you can find the amount for tha one line per PO's Item
WRITE AMOUNT.
CLEAR AMOUNT
ENDLOOP.
ENDLOOP.
‎2009 May 21 3:46 PM
This looks pretty straightforward. Why don't you try coding this yourself and get back to the forum if you have a specific question?
Rob