on ‎2025 Jan 30 4:14 PM
The goal is to ensure PO line items don't exceed the approved amount on the corresponding Purchase Requisition (PR).
Here's a simplified explanation:
Check for PR Reference: For each item in the PO (table EKPO), the system first checks if it's linked to a PR. It does this by looking at the BANFN (PR Number) and BNFPO (PR Item) fields. If these fields are blank, it means the PO item isn't related to a PR, and the system skips this item. We only care about PO items that are based on PRs.
Get PR Amount: If a PR link exists, the system retrieves the approved amount for that PR item. It goes to the EBAN table (PR table) and uses the BANFN (PR Number) and BNFPO (PR Item) as search criteria. It then fetches the NETWR field, which represents the PR item's net value (approved amount).
Calculate Total PO Amount for Each PR: Now, for each unique PR referenced in the PO, the system calculates the total amount of all PO items related to that specific PR. It sums up the NETWR (Net price) of all PO items that have the same BANFN (PR Number). Think of it as grouping PO items by PR and summing their amounts.
Compare and Validate: The crucial step: the system compares the total PO amount calculated in the previous step with the original PR amount fetched from EBAN. This comparison is done for each PR referenced in the PO.
Error Message: If the total PO amount for a given PR exceeds the PR amount, the system throws an error message: "PO amount exceeds PR amount for PR: ****** (the PR number). Please adjust the PO amount." This prevents POs from being created that overspend the approved PR budget.
In essence: The enhancement ensures that the total amount of all PO items linked to a specific PR never goes over the approved amount on that PR. It acts as a budget control mechanism during PO creation.
Example:
Let's say PR 12345 has an approved amount of $1000. A PO is being created with two items linked to PR 12345:
The system will:
This prevents the PO from being saved until the amounts are adjusted.
Request clarification before answering.
Use the provided macros to handle error message as in this answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.