cancel
Showing results for 
Search instead for 
Did you mean: 

jbdc sender adapter: problem whit numeric format

Former Member
0 Kudos

hello!

i have a jdbc (sql server)->xi->RFC interface in my XI 3.0 .

On the table i'm reading a double field and i map it into a string field.

But numeric format are changed inside XI.

So when on table i have a number like this: 12.12345 on monitor i'll find this: 12.1234499999999999999

And later on rfc too...

any suggestion?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

this may be an effect of the string field lenght XI maps the source to. You could cut or round the value during mapping with XI to avoid this.

Regards,

Kai

Former Member
0 Kudos

no because if i cut number i have 12.12344 insteadh of 12.12345 and this is not correct.

i tried to change format in Data Type but result no chnage

Former Member
0 Kudos

And did you try the round function in your mapping?

round

O = integer value back that is closest to the value of argument I. Corresponds to the Java function java.lang.Math.round().

Former Member
0 Kudos

tried but didn't work because sometimes i have number whit this format:

6.6000000000000003E-2

so i need manage data in very complicated way inside the mapping and i'm afraid about it

former_member181962
Active Contributor
0 Kudos

Hi,

Have your tried FormatNum function?

As per sap help (http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm)

the possible patterns are the same as in the Java class java.text.DecimalFormat

Regards,

Ravi

Former Member
0 Kudos

Hi,

What SP level you have.

Are you using any other step in between your Source & Target field mapping?

Try to implement this...

/people/thorsten.nordholmsbirk/blog/2006/08/25/new-arithmetic-and-statistical-functions-in-message-mappings-in-sp18

Regards,

Sarvesh

Former Member
0 Kudos

Alessandro,

XI does not change the data while it is fetching from the table. I think it is stored in the database as 12.2344444449 internally and the display is being rounded off. I am sure XI does not do this conversion. Use a SQL statement (the same you are using on JDBC adapter) and try to see what is the content of the field.

Regards

Jai

Former Member
0 Kudos

oh!!! yes! true

so... can i FormatNumber function for normalize data??

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi alessandro,

yes, as the others partners said before, you can use the the funtion formatNumber as you need.

Thanks

former_member181962
Active Contributor
0 Kudos

Hi Alessandro,

I have just checked in my system.

FormatNumber works for even values like 123.98789E-2 also.

Just Specify your format as 00.00000

Regards,

Ravi

Former Member
0 Kudos

Ok thanks

i try whit this

Answers (0)