Converting URRF to LNID

JDE0101

Active Member
hi,
i have a (valid) line id stored in a URRF field. i would like to convert this to the LNID Math Numeric type..i cant see how this is possible??
eg
URRF [String] 3.000
i would like
LNID 3.000

is there any busy functions that would do this???
jde xe b733 as/400 citrix sp 22
is there
 
Hello, cdawg

To convert string to numeric you can use one of the Business Functions available... from a quick search I got the following:

Function Name Source Module
StringToNumeric BD3N070
ConvertStringToMathNumeric B0000580
ConvertStringToNumeric B4000770

Regards,
 
The easiest way to to convert a string to number is to use the assignment statement. You will have to click on the function button in order to select the string you wish to assign to the math numeric variable.
 
So I tested both ways, using B0000580 and the direct assignment and on both cases, althought the conversion happens, the result is not shown properly, because the string for "3.000" becomes three thousand, which is over the LNID range.

So you do the ugly thing, and divide the resulting LNID by 1000, and it works. :)
 
Marcelo,

Before they go and do the ugly thing, would you plug one other function in and try it? The function is Algebraic Expression Calculate - B0000500. Many years ago, I remember researching for the best string to numeric function and came across this one. I understand that it seems like overkill for just conversion from string to numeric, but it seemed to be one function that took into account a large number with possibly large decimals and not lose out in rounding.

I would normally test it out before recommending it, but am unable to test it in a timely fashion and thought you might be able to plug it in to your test.

Ben again,
 
thanks so far all, i will plug each of these bs fn into my code tomorrow..

I am ok with string->numeric fns for example converting 1965333 to math numeric..my issue was to preserve the decimal places.

i will report back any findings. if anyone has more unobvious work arounds for me to test please let me know :)
 
[ QUOTE ]
...The function is Algebraic Expression Calculate - B0000500.

[/ QUOTE ]

So I did, and it worked just fine.
If you pass URRF as if it were the algebric expression, and LNID as the resulting numeric, the function considers the "." and correctly calculates the value with decimals.

I have used this BSFN before, but never for simple convertion.

Thanx, Ben.
smile.gif
 
thanks all, B0000500 worked a treat.

Note to anyone using - in order to handle ".000" it returns ok from the BSFN but remember to allow zero output on the Report Variable properties..

:)
thanks all
 
Back
Top