Hi,
I am looking into setting up a dashboard to monitor contract leakage in the form of paying a higher price for a specific item than agreed in a contract.
1.) I would like to obtain a count of purchase order items that were purchased outside of an existing valid contract.
2.) I would like to obtain an indication on the cash value (difference between PO price and contract price)
In our data model EKPO consists of both, purchase orders (EKPO.BSTYP = F) and contracts (EKPO.BSTYP = K). Now, I would like to compare the material number (EKPO.MATNR) for all EKPO.EBELN where EKPO.BSTYP = F with the material number for all EKPO.EBELN where EKPO.BSTYP = K.
Whenever there is a match:
1) Check if the contract number (EKPO.KONNR) in the PO (EKPO.BSTYP = F) equals the contract number (EKPO.EBELN) of the respective contract (EKPO.BSTYP = K)
If not, the item was purchased outside of the frame agreement.
If EKPO.KONNR empty, the item was also purchased outside of the frame agreement
2) The NETPR of both lines should be compared and counted how often the NETPR of the PO (EKPO.BSTYP = F) is higher than the NETPR of the contract (EKPO.BSTYP = K)
Is that possible in the same table, or do we have to split the data somehow?
Example 1:
EKPO.MATNR 123 was bought in PO "100001", but without respective contract (Purchase order because EKPO.BSTYP = F; no respective contract because EKPO.KONNR = "-").
EKPO.MATNR "123" is part of contract "200001" (Contract because EKPO.BSTYP = K)
So 100001 was purchased outside of a contract even though there is one in place ("200001"). It was also purchased at a higher price (10 vs. 5) than agreed in contract "200001".
Example 2:
EKPO.MATNR "245" was bought in PO "100002" for a price of 20 (EKPO.NETPR) under contract "200002" (EKPO.KONNR).
There is also a contract "200002" in place for EKPO.MATNR "245" for a price of "20".
EKPO.KONNR of the PO equals EKPO.EBELN of the contract ("200002") and the price is also correct.
Since PU functions don't work within the same table, I don't know how to approach this task. Is there someone who knows more?