Currency Code on Numeric Variables in NER not getting populated

Jeff Dhaene

Active Member
Hi, I am going to give a full explanation of my problem, hopefully someone can help me out, I don’t think it’s going to be a very complicated solution.
I am calling NER in a report which calls the “TaxCalculator” business function (B4001090). I’ve passed in the exact same values in the parameters that is passed in when applications call it. However my tax amount comes back rounded.
I have done lots of digging to find the root cause which I will explain. When im running in debug and I enter in the NER, all numeric variables like mnAmtTax have in values such as String being the actual value, szCurrency being the currency, nCurrencyDecimal etc.
All my variables have szCurrency as blank when I call my report that calls this BF. When I call this BF using an application it seems that my currency is tied to the variables, it says szCurrency=’CAD ‘ and nCurrencyDecimal=2
Am I suppose to call some system or business function so I can get this set? I haven’t had any problems before with this however this specific BF calls CalculateValidateTaxAmounts which will eventuall call an internal function (IDXX00026_GetDecimals) which gets the decimal positions for the currency, and in this case since the currency is blank, it returns 0. This causes my tax to get truncated.
I realize in the BF there is a variable that is called mnUnroundedTaxAmt, but to me that doesn’t seem like it’s the right one to use. Some how my BF needs to get visibility that the currency code is ‘CAD’ which is our default currency.
Ive thought about adding a blank currency with decimals = 2 but for one, this isn’t more of a work around and for two, I can’t add blank currency.
I thought about just using the mnUnroundedTaxAmt but then that’s not rounded properly and is once again more of a work around.
I hope someone can tell me the proper solution to get this to work, Ive been testing calling my NER in a report but in the end It will be called via INTEROP and is crucial to get our pricing working properly.
Anyone have any thoughts? I can provide any information you would like that you might find useful to help me out. I have done a fair amount of programming in JDE and have a very good understanding for the most part how everything woks, however this one im clued out on.
Thanks for your help
Jeff
 
Jeff,

Have you tried using the BSFN - Decimal Trigger Get by Currency (B1100006)? Pass the currency code in parm 1 (CAD for example) and pass your numeric variable(s) in the amount fields. This will set the MATH_NUMERIC data structure members with the currency information of CAD.

Craig
 
At first glance, looks like this solves it 100% thanks for the help, greatly appreciated.
 
I tried passing parameters in B1100006 and calling tax calculation BSFN. But the tax amount value I am getting is still rounded off. Anything else I might be missing ?
 
This worked!! It was failing when I was testing from the Object Browser. Later when I did it programmatically it worked. Thanks!
 
in Object Browser, you can set the currency and decimals for Math Numeric structure members. Click the $ icon in the BSFN toolbar or select Currency Columns from the Object menu. Then you can enter the values and the structures should get updated before the call.

Craig
 
Back
Top