Purpose of this document is to explain the routine of error 0252 (Invalid Extended Price) through business function B4100030 - VerifyQuantityCostExtended (Inventory Trn, Verify Unit Cost vs Extended) in Inventory Transaction, Procurement and Sales Order Processing, which shall cover:
B4100030 - VerifyQuantityCostExtended (Inventory Trn, Verity Unit Cost vs Extended)
Purpose: To validate the cost, quantity, extended amount combination for a transaction. If all three are entered, make sure that it is a valid combination. If any one is missing, issue an error if necessary or calculate the third field. If the cost is blank and a quantity is entered, the cost will be retrieved from the F4105. The cost entered will be converted to primary unit of measure for later functions.
Setup Notes and Prerequisites: The PRRC field will return the PRIMARY unit cost to be used for later functions.
Special Logic: Will need to convert the unit cost to primary unit of measure and return in PRRC fields.
Parameter:
Data Structure: D4100030 : Verify Quantity Cost Extended
Structure Member Name
Data Type
Req
I/O
Alias
Others
mnTransactionQuantity
MATH_NUMERIC
Y
I/O
TRQT
Transaction Quantity bIsTRQTZero
mnTransactionUnitCost
MATH_NUMERIC
Y
I/O
UNCS
Amount - Unit Cost bIsUNCSZero
mnExtendedCost
MATH_NUMERIC
Y
I/O
PAID
Amount - Extended Cost/Price bIsPAIDZero
mnPrimaryUnitCost
MATH_NUMERIC
N
O
PRRC
Amount - Primary Unit Cost
mnConversionFactorFromToPrimry
MATH_NUMERIC
N
O
CONV
Conversion Factor From to Primary
mnConversionFactorPriceToPrim
MATH_NUMERIC
Y
I
CONV
Conversion Factor Price To Primary
cCurrencyControl
CHAR
Y
I
CRYR
Currency Conversion Y/N/Z This flag is to indicate whether to compute cost for foreign amount. Default 'N' (different from value from F0009.DOT1 value) Y when cCalculateForeignAmount is IN ('1', 'y', 'Y')
mnForeignUnitCost
MATH_NUMERIC
N
I
FCSTR
Amount - foreign Unit Cost Received bIsFCSTRZero
mnForeignExtendedCost
MATH_NUMERIC
N
I
FOPNR
Foreign Extended Cost bIsFOPNRZero
mnPrimaryTransactionQuantity
MATH_NUMERIC
N
I
QAVAL
Primary Transaction Quantity
mnQuantityConvertedToPrimary
MATH_NUMERIC
N
I
QTY
Quantity Converted To Primary
Processing/Detail Routine/Error handling:
The following edits will be performed. Check input parameters:
Error '0003 - Blanks Invalid' stops the processing
One of the three fields (transaction quantity (mnTransactionQuantity), unit cost (mnTransactionUnitCost), extended cost (mnExtendedCost)). If not (all 3 parameters are not specified) , issue error '0003'.
If only the unit cost (mnTransactionUnitCost) is entered (but (mnTransactionQuantity = 0 AND (mnExtendedCost = 0)), issue error '0003'.
If cost ((mnTransactionUnitCost <> 0) and extended (mnExtendedCost <> 0) are entered, but no quantity (mnTransactionQuantity = 0) , issue error '0003'.
Issue error '0252 - Extended Price Invalid' and stops the processing when the quantity and extended cost fields have opposite signs. Issue error '0252'. For this example, quantity * Unit Cost = Extended Cost so,
(mnTransactionQuantity < 0) AND (mnTransactionUnitCost < 0) AND (mnExtendedCost <0) (because Negative * Negative = Positive)
OR (mnTransactionQuantity > 0) AND (mnTransactionUnitCost > 0) AND (mnExtendedCost <0) (because Positive * Positive = Positive)
OR (mnTransactionQuantity < 0) AND (mnTransactionUnitCost > 0) AND (mnExtendedCost > 0) (because Negative * Positive = Negative)
Note: ConversionFactorFromToPrimry should be used instead of ConversionFactorFromPriceToPrimary; since all the transaction extended cost is based on transaction uom to primary uom
Simplified routine can be found at P98ABSFN (Business Function Documentation Viewer) or P98652 (Business Function Search)
Most errors are coming from case 1 because 3 parameters are computed through calling routines
Depends on parameters assigned. The routine to compute is different so verify whether the parameters are handled correctly when you face error '0252'
Only Round the result when the currency flag is on and there are values other than '1' in the Divisor
Computation repeats by calling Internal Function I4100030_Calculate ()
Error 0252 detail:
Extended Price Invalid
Cause. . . . . The Extended Price entered is incorrect. The Extended Price should equal the number of units multiplied by the unit price. Resolution . . Correct the Extended Price or blank out your entry and let the system calculate the Extended Price.
Prototype of I4100030_Calculate () Prototype of calculation is,
void I4100030_Calculate ( LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPMATH_NUMERIC lpmnDiv1, LPMATH_NUMERIC lpmnDiv2, LPMATH_NUMERIC lpmnDiv3, LPMATH_NUMERIC lpmnMult, LPMATH_NUMERIC lpmnResult, LPMATH_NUMERIC lpmnCurrency, JCHAR cUnitCost ) /* to indicate whether lpmnResult is Unit Cost or not. If value is 1 then display decimal is same with display decimal of UNCS */ {
If mnPrimaryUnitCost <> mnTransactionUnitCost / mnConversionFactorFromToPrimary then set error 0252
XT4111Z1 and B4100030
All inventory transaction calls XT4111Z1 to validate inventory and create its cache (F41UI11) and XT4111Z1 calls B4100030 to validate. As written at <Document 1276239.1> - E1: 41: Inventory Transaction MBF XT4111Z1 Clarification, all inventory transaction calls B4100030 (refer to parameter cCalculateQtyCostExt in section "How data gets validated?" in this document) except for R41413 (Cycle Count Update) and R41610 (Tag Inventory Update).
Simplified routine for IX4111Z1_CalculateUnitCost(..)
If Transaction Unit Cost and Transaction Extended Cost passed in equal zero,
Transaction Unit Cost = Inventory Unit Cost (iticos) * ConversionFactorFromToPrimary
If Foreign Unit Cost and Foreign Extended Cost passed in equal zero,
Foreign Unit Cost = Inventory Unit Cost (iticos) * ConversionFactorFromToPrimary
Call VerifyQuantityCostExtended(...) using ConversionFactor from
GetItemUOMCoversionFactor(..).
Retrieve UNCS, TRQT, PAID, PRRC, FCSTR, and FOPNR for F41UI001
Retrieve TRQT, PAID, UNC, FCSTR, and FOPNR for lpDS
Typical Implementation (Example of P4205 Shipment Confirmation):
This section is to explain what we need to check in hitting error '0252' during Shipment Confirmation.
If you face errors in running a certain Inventory Transaction, review how the BSFN B4100030 gets called
If possible, capture CallObject Kernel log (JDEDEBUG_*.log) and verify each Input and Output parameter
Even in same application, this function can be called multiple times to validate and compute different values so try to understand this in the transaction
Direct calling B4100030 (not through XT4111Z1) As explained above B4100030 is normally getting called by Inventory Transaction Master Business Function XT4111Z1 except for PO receipt transaction. B4100030 is to be called only when user made change in quantity, unit cost and/or extended cost during PO Receipt.
cf., B4002000 - ComputeUnitOrExtendedAmount (Order, Calculate Unit or Extended Amount) which can be called across Order Processing. This business function also can issue error '0252 - Extended Price Invalid' or '4377 - Invalid Input Parameter'. Currently this supports different cModeOfProcessing (1 to compute Unit Price, 2 to compute extended amount and 3 to validate quantity, Unit Price and Extended Amount).
For this example, XT4312Z2 can be called either from PO Receipt (e.g., P4312) or Receipt Routing (P43250). In case the outcome between 2 transactions are different from each other, check whether all the parameters are assigned same or not
P4312 - Purchase Order Receipt (Row is Exited/Changed Asynch) |--- XT4312Z1 - F4312EditLine (F43121 Edit Line) which is XT4312Z2 - F4312EditLineInternalFunctions (F4312 Edit Line Internal Functions) |--- IXT4312Z1_EL_F4111EditLine (Internal function before it calls F4111EditLine so PO receipt routine is different from other inventory transactions) |--- IXT4312Z1_EL_AssignQtyAmtCst (Internal function to compute amount and cost) |--- IXT4312Z1_EL_CalculateAmounts (before calling XT4111Z1 so quantity, unit cost and extended cost value for XT4111Z1 and B4100030 are identical) |--- VerifyQuantityCostExtended
List of applications which can issue error '0252' Applications listed below can issue error code '0252'. In case the error message is coming from P4312 or P43250 check F4312EditLine, F4111EditLine and B400030 otherwise check F4111EditLine to determine the cause of your issue.
P4312 (PO Receipts)
P43250 (Receipt Routing Movement and Disposition)
P4205 (Shipment Confirmation)
P49640 (Transportation Load Confirmation)
P4314 (Voucher Match)
Considerations
Check currency display decimal (for example, JPY, TWD and KRW which has 0 display decimal) the result can be different from other currency amount
Check display decimal for columns belong to QTYINV class which results in different result
Partial Receipt and Partial Shipment because it has to compute amount based on partially received or shipped quantity
PO receipt reversal including sign of values
Case Study
As described above B4100030 - VerifyQuantityCostExtended (Inventory Trn, Verify Unit Cost vs Extended) can be called either through F4111EditLine or F4312EditLine. So below example may enable you to debug your issue in running any Inventory Transaction.
Example 1: In running P49640 (Transportation Load Confirmation) user hits error '0252'.
To debug this issue better,
1. Capture/trace CallObject Kernel Log (namely, jdedebug.log), which reads,
Calling Business function LoadConfirmEditLine from Level 1 for JDE. Application Name [P49640], Version [ZJDE0001] (BSFNLevel = 1) ... IN->[ 15] mnQuantityTransaction [5000.0000] IN->[ 16] szUnitOfMeasureTransact [LT] *** ORCL: 3 parameters in F4111EditLine (mnTransactionUnitCost, mnTransactionUnitCost and mnTransactionExtendedCost are computed by LoadConfirmEditLine ***
... Calling Business function F4111EditLine from LoadConfirmEditLine for JDE. Application Name [P49640], Version [ZJDE0001] (BSFNLevel = 2) ... IN->[ 7] szTransactionUOM [LT] IN->[ 8] mnTransactionQuantity [-5000.0000] IN->[ 9] mnTransactionUnitCost [83.0200] *** ORCL: This parameter is retrieved/computed through LoadConfirmEditLine *** IN->[ 10] mnTransactionExtendedCost [0] ... IN->[ 49] szPriceCostUOM [] IN->[ 50] mnConversionFactorFromToPrimry [0] IN->[ 51] mnConversionFactorPriceToPrim [0] IN->[ 52] mnTransactionForeignUnitCost [0] IN->[ 53] mnTransactionForeignExtendCost [0] ...
Calling Business function VerifyQuantityCostExtended from F4111EditLine for JDE. Application Name [P49640], Version [ZJDE0001] (BSFNLevel = 3) IN->[ 1] mnTransactionQuantity [-15000] *** ORCL: For this example, each compartments can hold 5000 LT and this routine is combined figure *** IN->[ 2] mnTransactionUnitCost [83.020000000000000000] *** ORCL: F4111EditLine.mnTransactionUnitCost which is assigned by LoadConfirmEditLine *** IN->[ 3] mnExtendedCost [-1260900] *** ORCL: this value is computed through F4111EditLine routine *** IN->[ 4] mnPrimaryUnitCost [0] IN->[ 5] mnConversionFactorFromToPrimry [1] *** ORCL: this value are handled by F4111EditLine *** IN->[ 6] mnConversionFactorPriceToPrim [1] *** ORCL: this value are handled by F4111EditLine *** IN->[ 7] cCurrencyControl [N] *** ORCL: this value are handled by F4111EditLine *** IN->[ 8] mnForeignUnitCost [83.02] IN->[ 9] mnForeignExtendedCost [.00] IN->[ 10] mnPrimaryTransactionQuantity [-15000] IN->[ 11] mnQuantityConvertedToPrimary [-15000]
For easier reading, some parameters are missing from the above example
When hitting error, capture the callobject kernel log
Check available Bugs and ESUs based on the callstack above. For this example, check bugs against the objects N4900780 (LoadConfirmEditLine) and XT4111Z1 (F4111EditLine)
For this example, 3 parameters (mnTransactionQuantity, mnTransactionUnitCost, mnExtendedCost) are specified so validation routine Case 1 takes effect
Example 2: In moving routing steps to stock through P43250 (Receipt Routing Movement and Disposition) the amount computed is different from P4312 (PO Receipts). How to debug this? 1. To debug issue trace callobject kernel for both P4312 and P43250 2. Analyze CallStack through Performance workbench
P4312 - PO Receipts |--- XT4312Z2 - F4312EditLine (F43121 Edit Line) |--- B4002000 - ComputeUnitOrExtendedAmount (Orders, calculate Unit or Extended Amount) ** ORCL: this can be called multiple times ** |--- B4100030 - VerifyQuantityCostExtended (Inventory Trn, Verify Unit Cost vs Extended)
P43250 - Receipt Routing Movement and Disposition |--- NXT43092 - F43092EditLine (F43092 Edit Line) |--- XT4312Z2 - F4312EditLine (F43121 Edit Line) |--- B4002000 - ComputeUnitOrExtendedAmount (Orders, calculate Unit or Extended Amount) ** ORCL: this can be called multiple times ** |--- B4100030 - VerifyQuantityCostExtended (Inventory Trn, Verify Unit Cost vs Extended)
Note:
Both applications are calling VerifyQuantityCostExtended from F4312EditLine
But P43250 calls F4312EditLine through F43092EditLine whereas P4312 calls F4312EditLine directly
So it is important to check the routine call F4312EditLine one from P4312 and the other from NXT43092
3. Analyze Detail Routine: P4312 - PO Receipts
Calling Business function F4312EditLine from Level 1 for JDE. Application Name [P4312], Version [ZJDE0001] (BSFNLevel = 1) ... IN->[ 16] mnQuantityReceived [3277] IN->[ 17] szReceiptUOM [EA] IN->[ 18] mnUnitCostReceived [904.2346] IN->[ 19] mnForeignUnitCostReceived [0] *** ORCL: Note that mnForeignUnitCostReceived is not assigned through P4312 *** IN->[ 20] mnAmountReceived [2964081] IN->[ 21] mnForeignAmountReceived [37858.40] ...
Calling Business function VerifyQuantityCostExtended from F4312EditLine for JDE. Application Name [P4312], Version [ZJDE0001] (BSFNLevel = 2) IN->[ 1] mnTransactionQuantity [3277] IN->[ 2] mnTransactionUnitCost [11.552761672] *** ORCL: So this value is computed through XT4312Z2 routine *** IN->[ 3] mnExtendedCost [37858.4] IN->[ 4] mnPrimaryUnitCost [0] IN->[ 5] mnConversionFactorFromToPrimry [1] IN->[ 6] mnConversionFactorPriceToPrim [1] IN->[ 7] cCurrencyControl [Y] IN->[ 8] mnForeignUnitCost [0] IN->[ 9] mnForeignExtendedCost [0] IN->[ 10] mnPrimaryTransactionQuantity [3277] IN->[ 11] mnQuantityConvertedToPrimary [3277] OUT->[ 1] mnTransactionQuantity [3277] OUT->[ 2] mnTransactionUnitCost [11.552761672] OUT->[ 3] mnExtendedCost [37858.4] OUT->[ 4] mnPrimaryUnitCost [11.5528] OUT->[ 5] mnConversionFactorFromToPrimry [1] OUT->[ 6] mnConversionFactorPriceToPrim [1] OUT->[ 7] cCurrencyControl [Y] OUT->[ 8] mnForeignUnitCost [0] OUT->[ 9] mnForeignExtendedCost [0] OUT->[ 10] mnPrimaryTransactionQuantity [3277] OUT->[ 11] mnQuantityConvertedToPrimary [3277] Return value is 0 for VerifyQuantityCostExtended. (BSFNLevel = 2)
P43250 - Receipt Routing Movement and Disposition
Calling Business function F43092EditLine from Level 1 for JDE. Application Name [P43250], Version [ZJDE0001] (BSFNLevel = 1) ...
Calling Business function F4312EditLine from F43092EditLine for JDE. Application Name [P43250], Version [ZJDE0001] (BSFNLevel = 2) ... IN->[ 16] mnQuantityReceived [3277] IN->[ 17] szReceiptUOM [EA] IN->[ 18] mnUnitCostReceived [904.2347] IN->[ 19] mnForeignUnitCostReceived [11.5528] *** ORCL: Note that the value is assigned in calling F4312EditLine *** IN->[ 20] mnAmountReceived [2963177] IN->[ 21] mnForeignAmountReceived [37858.40] ...
Calling Business function VerifyQuantityCostExtended from F4312EditLine for JDE. Application Name [P43250], Version [ZJDE0001] (BSFNLevel = 3) IN->[ 1] mnTransactionQuantity [3277] IN->[ 2] mnTransactionUnitCost [11.5528] *** ORCL: Same amount assigned is used for input parameter *** IN->[ 3] mnExtendedCost [37858.40] IN->[ 4] mnPrimaryUnitCost [0] IN->[ 5] mnConversionFactorFromToPrimry [1] IN->[ 6] mnConversionFactorPriceToPrim [1] IN->[ 7] cCurrencyControl [Y] IN->[ 8] mnForeignUnitCost [0] IN->[ 9] mnForeignExtendedCost [0] IN->[ 10] mnPrimaryTransactionQuantity [3277] IN->[ 11] mnQuantityConvertedToPrimary [3277] OUT->[ 1] mnTransactionQuantity [3277] OUT->[ 2] mnTransactionUnitCost [11.5528] OUT->[ 3] mnExtendedCost [37858.40] OUT->[ 4] mnPrimaryUnitCost [11.5528] OUT->[ 5] mnConversionFactorFromToPrimry [1] OUT->[ 6] mnConversionFactorPriceToPrim [1] OUT->[ 7] cCurrencyControl [Y] OUT->[ 8] mnForeignUnitCost [0] OUT->[ 9] mnForeignExtendedCost [0] OUT->[ 10] mnPrimaryTransactionQuantity [3277] OUT->[ 11] mnQuantityConvertedToPrimary [3277] Return value is 0 for VerifyQuantityCostExtended. (BSFNLevel = 3)
Note:
For this example VerifyQuantityCostExtended does not issue the error but it contributes to computing a wrong extended amount
Above example is to explain the amount (mnExtendedAmountPrimaryUM) difference between P4312 and P43250
In P43250, mnExtendedAmountPrimaryUM [2963186.9429] = mnQuantityTransactionUM [3277] ) * (mnUnitPricePricingUM [904.2377])} (which is domestic unit cost based on 11.5528 (=11.5528 * 78.2700000)
Expected result: P43250 should not recompute the domestic amount (this can be done by not sending 19th parameter mnForeignUnitCostReceived
To debug it, capture the callobject kernel log and compare the event rules for the objects which call F4312EditLine
Example 3:
EDI Inbound 861- Receiving Advice (R47071) and PO Receipts (P4312) behavior differently in specifying F47072.FUC (Amount - Foreign Unit Cost). The former fails to reset Foreign Unit Cost and Amount whereas the latter is able to set valid outcome. Note that depending on the processing option for parameter 17. Price At Receipt (with Available values Blank = Do not price at receipt, 1 = Price at receipt) in Process tab, the outcome can be vary. For detail, refer to Bug 17233239 - FAP&FREC NOT UPDATED BY FOREIGN PRICE CHANGE.
Note: The business function B4500251 serves as an interface function for Receipts as well as for the settlement, Grower and contract modules. When called for any other module other than receipts i.e when a transaction does not exist, then the Price engine B4500250 is called in a price only mode.Also for these other modules other than receipt the processing mode used by B4500250 and B4500050 will be a 'P' for procurement.
Business scenario,
The foreign unit cost during PO entry was 14.9999 and F47072.FUC is updated with value 15.0960.
Calling Business function F4312EditLine from Level 1 for USERID. Application Name [R47071], Version [ZJDE0001] (BSFNLevel = 1) ... IN->[ 16] mnQuantityReceived [2500] IN->[ 17] szReceiptUOM [EA] IN->[ 18] mnUnitCostReceived [1262.6294] IN->[ 19] mnForeignUnitCostReceived [14.9999] *** both R47071 and P4312 sets same value for this parameter *** IN->[ 20] mnAmountReceived [.] IN->[ 21] mnForeignAmountReceived [37740.00] ... IN->[ 42] mnExchangeRate [83.6400000] ...
Calling Business function VerifyQuantityCostExtended from F4312EditLine for USERID. Application Name [R47071], Version [ZJDE0001] (BSFNLevel = 2)
IN->[ 1] mnTransactionQuantity [2500] IN->[ 2] mnTransactionUnitCost [14.9999] *** this value has to be written as 15.0960 which is actual foreign unit cost for receipt *** IN->[ 3] mnExtendedCost [37740.00] IN->[ 4] mnPrimaryUnitCost [0] IN->[ 5] mnConversionFactorFromToPrimry [1] IN->[ 6] mnConversionFactorPriceToPrim [1] IN->[ 7] cCurrencyControl [Y] IN->[ 8] mnForeignUnitCost [0] IN->[ 9] mnForeignExtendedCost [0] IN->[ 10] mnPrimaryTransactionQuantity [2500] IN->[ 11] mnQuantityConvertedToPrimary [2500] ERROR INFO JDEERR - ID= 8, Error= 0252 - b4100030.c, Line= 353 OUT->[ 1] mnTransactionQuantity [2500] OUT->[ 2] mnTransactionUnitCost [14.9999] OUT->[ 3] mnExtendedCost [37740.00] OUT->[ 4] mnPrimaryUnitCost [0] OUT->[ 5] mnConversionFactorFromToPrimry [1] OUT->[ 6] mnConversionFactorPriceToPrim [1] OUT->[ 7] cCurrencyControl [Y] OUT->[ 8] mnForeignUnitCost [0] OUT->[ 9] mnForeignExtendedCost [0] OUT->[ 10] mnPrimaryTransactionQuantity [2500] OUT->[ 11] mnQuantityConvertedToPrimary [2500] Return value is 2 for VerifyQuantityCostExtended. (BSFNLevel = 2)
Note:
This process is to validate foreign amount
Validation: mnExtendedCost = mnTransactionQuantity * mnTransactionUnitCost = 2500 * 14.9999 = 37499.75 (so mnExtendedCost 37740 is different from 37499.75) so error code '0252' has to be issued
To avoid error and update correct foreign amount buckets, mnTransactionUnitCost has to be handed over from user overridden value
<Internal_Only> Additional Case study is to be implemented along the way</Internal_Only>