on 2025 Mar 20 5:56 PM - last edited Tuesday
Hi experts,
What approval query should be written to trigger approval for an A/P Invoice, if any data from the approved Purchase Order document, from which the A/P Invoice was created, is modified?
Thanks. Regards.
EDİT:
I wrote a query like the one below. What I’m trying to do is this: if a purchase order document that was created via approval (I check this using the draftkey field) is copied into a purchase invoice, and the quantity entered in the invoice is different from the quantity in the purchase order, then the invoice should go to approval.
But currently, regardless of whether I change the quantity or not, the approval is triggered anyway. For example, let’s say the quantity in the purchase order is 10. Even if the quantity in the invoice is also 10 (i.e., the same), the approval is still triggered, whereas it should only be triggered if the quantity is different.
SELECT DISTINCT 'TRUE'
FROM OPCH T0
INNER JOIN PCH1 T1 ON T0."DocEntry" = T1."DocEntry"
LEFT JOIN POR1 T2 ON T1."BaseEntry" = T2."DocEntry"
AND T1."BaseLine" = T2."LineNum"
AND T1."BaseType" = 22
LEFT JOIN OPOR T3 ON T2."DocEntry" = T3."DocEntry"
WHERE
T3."draftKey" IS NOT NULL
AND ( T2."Quantity" <> $[$38.11.NUMBER])
Request clarification before answering.
Hello,
As far as I understand, approval process is made to be run before the document is created (SAP B1 creates a draft). Approval process won't run after the document is already created nor in any document besides the one that is being created.
Maybe some expert can confirm this information.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
12 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.