cancel
Showing results for 
Search instead for 
Did you mean: 

XSD:Decimal to XSD:Decimal -ve value :->Mapping Error

Former Member
0 Kudos

Hello,

We have a EXX to file adapter scenario where source structure contains XSD:Decimal field and is passed to XSD:Decimal field in target structure. It seems to work fine except where we have -ve value.

How can we get rid of this issue.

I get the exception as follows

com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Invoice_Details_File/Details[400]/JNLLN_AMOUNT. The message is: Exception:[java.lang.NumberFormatException: For input string: 221166.66-"]in class com.sap.aii.mappingtool.flib3.Arithm method formatNumber[221166.66-, com.sap.aii.mappingtool.tf3.rt.Context@66a8d09a] at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:428) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:120) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest

---rest of the trace removed

Regards

Praveen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Are you using Formatnum on this field. If yes then thats the error because when sending negative number to formatnum it is throwing exception.

The best thing would be use an if else condition. If source fields --> endswith minus --> then use replace - with space and then trim --> now use formatnum and after that concat with - symbol --> if dont end with minus then use formatnum and pass as it is.

Regards,

---Satish

Edited by: Satish Reddy on Sep 23, 2009 8:41 AM

former_member182004
Contributor
0 Kudos

Hi,

Did you try putting the minus sign at the start of the number (-221166.66), instead of at the end? (221166.66-)

Regards,

Juan

Former Member
0 Kudos

Hi,

I thought of that but in other interfaces we have similar mapping they never failed with -ve values.

This has happened in production, i am quickly trying to replicate that in development to see if it works

Regards

Praveen

Former Member
0 Kudos

Hi,

FormatNumber will not work with such string with a negative sign at the end. you have to handle it during mapping before using the formatNumber.

regards,

rahul