2017 Feb 17 10:42 AM
Hi, I am rather new to ABAP, but have programmed in several other languages.
I have created a lot of reports in SQ02, but now i want to make one that shows just "Frame agreements" (EKPO - Contracts), on a top level (one line) and I am struggeling to get the “delivered value”.
I have calculated the lines of the contract as comparison to the contract value in the head. I have also added the value to all commitments (PO-lines, EKPO that have reference to the contract.
Now I want to calculate what’s delivered (Find EKPO where EKPO-KONNR = EKKO-EBELN and then sum up postings in EKBE where EKBE-EBELN = EKPO-EBELN and EKBE-EBELP = EKPO-EBELP)
I tried (which is obviously wrong) the code below, but I do not get any value in the delivery variable, even thou I know it has a delivered value:
DATA: i_EKPO TYPE TABLE OF EKPO,
i_EBELN TYPE EBELN,
i_EBELP TYPE EBELP,
i_KONNR TYPE KONNR.
SELECT * FROM EKPO INTO TABLE i_EKPOWHERE KONNR = EKKO-EBELN.
LOOP AT i_EKPO INTO i_EBELN.SELECT SINGLE SUM( WRBTR ) AS LINETOTALFROM EKBE INTO DVALUEDCP
WHERE EBELN = I_EBELN
AND EBELP = I_EBELP
AND BEWTP = 'E'
AND SHKZG = 'S'.ENDLOOP.
Can anyone help me get started?
B.R. Solve
2017 Mar 13 3:05 PM