cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI/XI wrong mapping conversion with big / small numbers

Former Member
0 Kudos

Dear Friends,

I have an strange issue with mapping conversion in XI. In a mapping I am using function div and when result is small (four decimals like 0.000023) it is given in scientifica format 2.3E-5 which is not acceptable for the target system. Same problem occurs with function sum when number are big, it gives result like 9.5E5 when the right format would be 950000.

Tha amazing part is that it is happening only in quality system and not in development system. (Interface it is not yet in production).

As a solution we can create our own Java funtion but I don't like that approach for this case and I would like to fix this issue.

Do you have any idea where the problem is and how to solve it?

Thank you for your help,

Manuel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Manuel,

If you are working on SAP XI 3.0 or SAP PI 7.0 you could also look into implementing SAP note 958486 - Arithmetic or Statistic function returns wrong result.

Best regards,

Jacob

Former Member
0 Kudos

Dear Jacob

That is the solution, I found looking for notes but your help is very much appreciated. Parameter com.sap.aii.mappingtool.flib3.bigdecimalarithmetic must be set to true.

In my case it was set in XID but not in XIQ/XIP.

Thank you for your help.

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I can still remember that there was a blog in XI telling not to use the built-in arithmetic functions. So yes, you have to do a workaround as suggested by Monika.

Regards,

Mark

Former Member
0 Kudos

Hello Mark,

Thank you for you answer. Do you have that blog? I didn't find anything searching in SDN.

Thanks,

Manuel

Former Member
0 Kudos

Dear Manuel

It is not a link 🙂

Well the blog that we are discussing is

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3446

Regards

Monika

Former Member
0 Kudos

Dear manuel

i faced the same issue once. The reason i found was

Reg conversion of 0.0001 to 1.0E-4

JDK documentation says for
Float type that the result is represented by sign and magnitude
(absolute value) and in case when magnitude is less than 10^-3 or
greater than or equal to 10^7, then it is represented in so-called
"computerized scientific notation" otherwise is represented by integer
part of the magnitude followed by '.' and one or more digits from the
fractional part of the magnitude.

In our case:
- 0.0001 is less than 10^-3 so the scientific notation is used.
- 5.5453 is between 10^-3 and 10^7 so the "normal" form is used

You would have to do a workaround in the source system itself, so that it comes to PI in the correct format,

Regards

Monika

Former Member
0 Kudos

Hello Monika,

Thank you for your answer.

Is 'Reg conversion of 0.0001 to 1.0E-4' a link? because it doesn't work for me.

What do you mean with a 'workaround in the source system', do you suggest to perform this calculation in source system? Unfortunately I cannot.

On the other hand, the strange case is that same file works in development environment but not in quality.

Thank you,

Manuel

Former Member
0 Kudos

Dear Manuel

It is not a link 🙂

Well the blog that we are discussing is

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3446

Regards

Monika