MathDivide API sets wrong Unit Cost, Extended Price and Transaction Quantities in Linux/Unix

Purpose

The purpose of this document is to demonstrate case study on MathDivide issue in Linux/Unix environment, however this document is not meant to encompass all rounding issues in EnterpriseOne.

Troubleshooting Steps

Symptoms

Wrongly computed Unit Cost, Extended Price and Transaction Quantity issue can be coming from multiple applications and transaction. Some example are,

This issue is specific to,

Changes

N/A

Cause

JDE API Mathdivide issue may occur when the Linux server operating system is installed with a non-English language. In such situations calculations for unit costs can be incorrect. For example, if a unit cost is 0.38 and there are 10 units, the extended cost is calculated as 0.00 rather than the expected 3.8. This issue occurs when BSFN logic runs on a Linux/UNIX Enterprise/Logic Server.

Solution

<Document 1126694.1> E1: OS: Known Issues When Running JDE Services on UNIX/Linux Enterprise Servers

Excerpt:

• Type locale on the server command line. This will list all the locale settings currently in place on your server.
• The LC_LANG should be set to US English.
• To set the language locale to US English,
o For csh/tcsh (C-shell): type the setenv command as follows:
setenv LANG en_US.UTF-8
o For ksh (korn shell) or sh (bash shell):
export LANG=en_US.UTF-8
Put this command in the shell initialization script to be executed at login time (.profile, .bashrc, .kshrc, etc.) It may require rebooting the Enterprise Server for the change to take effect.

Troubleshooting

Either error 0252 (Extended Price Invalid) is represented in HTML client or the value computed by a certain business function is wrong.

When you observe this type of issue,

1. Test it in your Local Web Environment (where it is applicable)

2. In case the outcome is different between Local Web client and HTML client, capture call object kernel log (namely, jdedebug.log) and compare it.

Example

Call Object Kernel log example:

Two different applications (P4114 and P4312) return different outcome thought it is calling same business functions.

A. P4114(Inventory Adjustment). User has not populated Extended Cost

Calling Business function VerifyQuantityCostExtended from F4111EditLine for JDE. Application Name [P4114], Version [ZJDE0001] (BSFNLevel = 3)
IN->[ 1] mnTransactionQuantity [100.0000]
IN->[ 2] mnTransactionUnitCost [.1500]
IN->[ 3] mnExtendedCost [0] *** Called function VerifyQuantityCostExtended has to compute mnExtendedCost ***
IN->[ 4] mnPrimaryUnitCost [0]
IN->[ 5] mnConversionFactorFromToPrimry [1]
IN->[ 6] mnConversionFactorPriceToPrim [1]
IN->[ 7] cCurrencyControl [N]
IN->[ 8] mnForeignUnitCost [.525]
IN->[ 9] mnForeignExtendedCost [0]
IN->[ 10] mnPrimaryTransactionQuantity [100]
IN->[ 11] mnQuantityConvertedToPrimary [100]

Entering MathDivide *** Any API called is to be represented in jdedebug.log ***
Entering MathDivide
Entering MathDivide
Entering MathDivide
Calling Business function GetDataDictionaryDefinition from VerifyQuantityCostExtended for JDE. Application Name [P4114], Version [ZJDE0001] (BSFNLevel = 4)
Return value is 0 for GetDataDictionaryDefinition. (BSFNLevel = 4)

OUT->[ 1] mnTransactionQuantity [100.0000]
OUT->[ 2] mnTransactionUnitCost [.500]
OUT->[ 3] mnExtendedCost [.] *** Note that this parameter is not populated as a result, F43121.ECST = 0 ***
OUT->[ 4] mnPrimaryUnitCost [0]
OUT->[ 5] mnConversionFactorFromToPrimry [1]
OUT->[ 6] mnConversionFactorPriceToPrim [1]
OUT->[ 7] cCurrencyControl [N]
OUT->[ 8] mnForeignUnitCost [.525]
OUT->[ 9] mnForeignExtendedCost [0]
OUT->[ 10] mnPrimaryTransactionQuantity [100]
OUT->[ 11] mnQuantityConvertedToPrimary [100]
Return value is 0 for VerifyQuantityCostExtended. (BSFNLevel = 3)

B. P4312 (PO Receipt): Computed value is to be validated

Calling Business function VerifyQuantityCostExtended from F4111EditLine for JDE. Application Name [P4312], Version [JDE001] (BSFNLevel = 3)
IN->[ 1] mnTransactionQuantity [1000,0000]
IN->[ 2] mnTransactionUnitCost [.1500]
IN->[ 3] mnExtendedCost [150.00] *** this value is populated, so called function VerifyQuantityCostExtended verifies whether mnExtendedCost = mnTransactionQuantity * mnTransactionUnitCost ***
IN->[ 4] mnPrimaryUnitCost [0]
IN->[ 5] mnConversionFactorFromToPrimry [1]
IN->[ 6] mnConversionFactorPriceToPrim [1]
IN->[ 7] cCurrencyControl [N]
IN->[ 8] mnForeignUnitCost [.525]
IN->[ 9] mnForeignExtendedCost [.00]
IN->[ 10] mnPrimaryTransactionQuantity [1000]
IN->[ 11] mnQuantityConvertedToPrimary [1000]

Entering MathDivide
Entering MathDivide
Entering MathDivide
Entering MathDivide

Calling Business function GetDataDictionaryDefinition from VerifyQuantityCostExtended for JDE. Application Name [P4312], Version [JDE001] (BSFNLevel = 4)
Return value is 0 for GetDataDictionaryDefinition. (BSFNLevel = 4)

Entering MathDivide
Entering MathDivide

Calling Business function GetDataDictionaryDefinition from VerifyQuantityCostExtended for JDE. Application Name [P4312], Version [JDE001] (BSFNLevel = 4)
Return value is 0 for GetDataDictionaryDefinition. (BSFNLevel = 4)

ERROR INFO JDEERR - ID= 22, Error= 0252 - b4100030.c, Line= 353

OUT->[ 1] mnTransactionQuantity [1000.0000]
OUT->[ 2] mnTransactionUnitCost [.1500]
OUT->[ 3] mnExtendedCost [150.00] *** As outcome of P4114 above reads, internally it determines the value to be is zero so above error 0252 is to be issued ***
OUT->[ 4] mnPrimaryUnitCost [0]
OUT->[ 5] mnConversionFactorFromToPrimry [1]
OUT->[ 6] mnConversionFactorPriceToPrim [1]
OUT->[ 7] cCurrencyControl [N]
OUT->[ 8] mnForeignUnitCost [.525]
OUT->[ 9] mnForeignExtendedCost [.00]
OUT->[ 10] mnPrimaryTransactionQuantity [1000]
OUT->[ 11] mnQuantityConvertedToPrimary [1000]
Return value is 2 for VerifyQuantityCostExtended. (BSFNLevel = 3)

Note: If the first two parameters (mnTransactionQuantity, mnTransactionUnitCost) are specified then it returns 3rd parameter (mnExtendedCost). If all three parameters (mnTransactionQuantity, mnTransactionUnitCost, mnExtendedCost) are specified then it computes 3rd parameter again and compare it with given value. Some case study shows it returns Integer.MAX_VALUE ( 2147483647).