Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XI mapping: rounding failure during "abs" function

Hello XIGurus,

I've met following problem I'd like to discuss with you.

I have simple XI mapping, where source is XI message (from BPM) and destination is IDOC "SALESORDER_CREATEFROMDAT2". The XI message contains only "string type" fields (!).

Now the point is, that XML field "Qty" contains number, which has 3 decimal places and could be negative (e.g. -14598.235). Since destination system (SAP R/3) needs the possitive values only, there is the "ABS" function in the XI message mapping, understand between the box "QTY" and box "REQ_QTY" there is in/out arithmetic box "abs" ;).

So far all should work fine, the test is OK, everything else seems fine. The troubles come, when there is a message load on XI. In this case it sometimes happened that the result value is correctly positive, but the decimal places are rounded wrongly or even the places are cut off. The example for all - two parts of XMLs from XI monitoring (one node in monitoring): the first before mapping, the second the result IDOC:

(before mapping)

- <ITEMS>

- <ITEM>

<DATE>20060408</DATE>

<LOCPROFROLE>A11</LOCPROFROLE>

<QTY><b>119995.825</b></QTY>

<UNIT>MWH</UNIT>

</ITEM>

- <ITEM>

<DATE>20060409</DATE>

<LOCPROFROLE>A11</LOCPROFROLE>

<QTY><b>116719.337</b></QTY>

<UNIT>MWH</UNIT>

</ITEM>

- <ITEM>

<DATE>20060410</DATE>

<LOCPROFROLE>A11</LOCPROFROLE>

<QTY><b>131552.004</b></QTY>

<UNIT>MWH</UNIT>

</ITEM>

</ITEMS>

(after mapping)

- <E1BPSCHDL SEGMENT="">

<REQ_DATE>20060408</REQ_DATE>

<REQ_QTY><b>119995.83</b></REQ_QTY>

</E1BPSCHDL>

- <E1BPSCHDL SEGMENT="">

<REQ_DATE>20060409</REQ_DATE>

<REQ_QTY><b>116719.336</b></REQ_QTY>

</E1BPSCHDL>

- <E1BPSCHDL SEGMENT="">

<REQ_DATE>20060410</REQ_DATE>

<REQ_QTY><b>131552</b></REQ_QTY>

</E1BPSCHDL>

Remeber - I use the "ABS" function only, there is nothing about rounding in the mapping.

So what would you say. Could be the problem, that source value is in XI field which is type of string ??? I don't have any other idea. It seems to me like a bug anyway. I'll try to write my JAVA function in the message mapping.

Thx for your comments.

Regards

Tomas

Not what you were looking for? View more on this topic or Ask a question