Issue using CBSFN "CalcDiscNoTax" B0000283

ashwin E1

Active Member
I encountered some strange behavior in this standard Cbsfn. I'm using JDE 9.2. There is a line of code which says "iDec = Decimals(&lpDS->mnAmountGross);"
This is used to know the Decimal place of the variable. When i debug this BSFN i see that when ever this BSFN is called from F0411Editline, this piece of code works but when i call this BSFN from my own UBE or APP it wont work though the inputs are exactly same.
For example you can test this BSFN(through Object browser) using these inputs:

IN->[ 1] <Item>: szTaxRateArea <type>: STRING <Value>: [ ]
IN->[ 2] <Item>: szTaxexplanationcode1 <type>: STRING <Value>: [ ]
IN->[ 3] <Item>: szPaymentTermsCode <type>: STRING <Value>: [110]
IN->[ 4] <Item>: mnAmountGross <type>: MATH_NUMERIC <Value>: [21847.60]
IN->[ 5] <Item>: mnAmtDiscountAvailable <type>: MATH_NUMERIC <Value>: [.00]
IN->[ 6] <Item>: mnRunTotalUnroundDisc <type>: MATH_NUMERIC <Value>: [0]
IN->[ 7] <Item>: mnDiscountPercent <type>: MATH_NUMERIC <Value>: [.01000]

and in the output we will expect mnAmtDiscountAvailable to be 218.47 but unfortunately it will always be 218.00. This happens when u test this bsfn from your own UBE or through Object Browser but will work fine when called from Edit line.

Any hints why this might be happening. I also noticed while debugging that the code doesn't go through iDec Variable Declaration.
 
In ObjectBrowser, try setting the currency and decimals of the input values. Hit the $ option from the BSFN toolbar to show the columns (USD, 2 for example). If that works, then you need to do the same in your code. IIRC B1100007.DecimalsTriggerGetbyCOCRCD is the currency trigger attached to F0411.

Craig
 
Back
Top