cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc Matmas.Matmas02 format error on element NETGW

Former Member
0 Kudos

Hello Guru's

I have a problem with the IDoc Matmas.Matmas02. I use the PI Development book and I want to set up an File to IDoc scenario.

The design and konfiguration of the scenario is finished. But it doesn't work. There is an error with the format of the element NETGW (Netweight). Due to the book I created the element NETGW in my datatype as xsd:decimal. But the IDoc format of this element is xsd:string. So if I'm in transaction BD87 an press "Process" i get a dump with this text:

The program attempted to interpret the value "001,800 " as a number, but

since the value contravenes the rules for correct number formats,

this was not possible.

My BRGW is 2. And is calculates the NETGW on its own with a factor of 0.9. The arithmetic expression should look like "1.800" i think.

What shall I do? Is it possible to change the IDoc are can you give me some other advices to solve this problem???

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi,

assumedly just a simple "FormatNum" function in your mapping would solve the problem. Apparently your ERP system expectes a "." as decimal separator.

Regards,

Udo

Former Member
0 Kudos

I tried a FormatNum but there was no difference. I will try it a second time with another separator.

Thanks

>>>>>>>>>

I put a FormatNum between my datatype element and the IDoc element and I got this error:

RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /MATMAS02/IDOC/E1MARAM/NTGEW. The message is: Exception:[java.lang.NumberFormatException: empty String] in class com.sap.aii.mappingtool.flib3.Arithm method formatNumber[, com.sap.aii.mappingtool.tf3.rt.Context@2b5c2b5c

I think is is not possible to change the format in front of an IDoc element because the format is exists already in the IDoc an can not be changend.

And what is with changing the IDoc element format? How can I do this?

Edited by: S.Simon89 on Apr 4, 2011 11:44 AM

Edited by: S.Simon89 on Apr 4, 2011 11:49 AM

RKothari
Contributor
0 Kudos

Hello,

Try using "replaceString" Text function to make ',' to '.' .

input value------>     replaceString---> Target Node
constant (,)--->/                
constant(.)----->/

Also, you can use the UDF for the same:

a.replaceAll(",",".");
return a;

-Rahul

Former Member
0 Kudos

Thanks for your reply. I don't understand what i should do now. I'm new to this topic. Can you explain it in detail for me please?

RKothari
Contributor
0 Kudos

Hello,

As mentioned earlier, you can try to use two approaches to replace the ',' comma by '.' decimal in PI mapping.

1. Try to use Text function 'replaceString' instead of FormatNum. You need to provide 3 input values to it.

a) source input field.

b) a constant value (,)

c) a constant value (.)

Assign the output of replaceString function to target Idoc node.

2. You can use a user defined function (java code):

Use the code:

a.replaceAll(",",".");
return a;

I hope it is helpful.

-Rahul

Answers (0)