on 03-10-2009 6:48 AM
Hi ,
My requirement is from the sorce I'm getting Amount data (both negative and possitive values)
if the value is negative then i want to convert it as possitive value. that means always i want to pass possitive values to my target side.
For this i have used ABS function AMOUNT (Source) ---> abs -
> AMOUNT (Target)
but now the problem is from the source I'm getting this value <AMOUNT>60179010.00</AMOUNT>
but while mapping it is converting and giving as <AMOUNT>60179008</AMOUNT>
I didn't understand this functinality . actually Abs function should just convert the sign of the value but why the value is also giving as mismatch.
please suggest me some solution for this..
Regards
jain
Hi Jain,
Yes. XI responds with a incorrect value.
Which SP are you in. This bug have been fixed in SP18. Have a look at this blog [Never, ever use XI's built-in arithmetic functions|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3446] [original link is broken] [original link is broken] [original link is broken];. it should help u.
Also have a look at this [New Arithmetic and Statistical Functions in Message Mappings in SP18|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4277] [original link is broken] [original link is broken] [original link is broken];
Thanks,
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This can be done without using UDF. you can use this mapping:
source --> replaceString --> Target Node
Constant: - --> /
Constant: --> /
Hope this helps,
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Jain,
Write an UDF for ABS function with this code,
double ret = Math.abs(Double.parseDouble(a));
return new java.math.BigDecimal(Double.toString(ret)).toString();
Try this. Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What SP are you on?
There have been lot of bugs in terms of the arithmatic functions in XI. But most of the issues have been solved in this release - http://help.sap.com/saphelp_nw04/helpdata/en/44/a7b4355d867455e10000000a11466f/content.htm
I suggest in case u are not on that SP upgrade to it or use a simple java UDF to do the abs conversion.
The math class in java can help you - http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html
Additional read - /people/thorsten.nordholmsbirk/blog/2006/04/03/never-ever-use-xis-built-in-arithmetic-functions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Jain,
I tried it in my server and it is working fine.
Pl chk again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.