cancel
Showing results for 
Search instead for 
Did you mean: 

Error while in Test mode

Former Member
0 Kudos

Hi all,

I get an error message everytime a certain field is blank. If it has a value, there is no error. I have already tried using mapwithdefault but there is still an error.

Error message:

The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Stat method sum[com.sap.aii.mappingtool.tf3.rt.C2CFunctionWrapper@6f5c73c1] com.sap.aii.mappingtool.tf3.MessageMappingException:

thanks

Regards,

IX

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

this is casting error if u try to store the value of filed of one data type to a field tha is of different data type (incompatible types) then u get this type of error.

So please check the data type of source and target fields ,If they are incompatible try to cast it.

Former Member
0 Kudos

I'm sorry but I think it's not about the casting. all of my nodes are of string type.

RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDP01[2]/MENGE(suppressed field). The message is: Exception:[java.lang.IllegalArgumentException: Cannot cast to float. ] in class com.sap.aii.mappingtool.flib3.Stat method sum[]

This is really weird since I dont have a E1EDP01[2] node in my target structure. Only E1EDP01 and E1EDP01[1]. I'm not sure what a suppressed field is. Thanks for all your reply.

Former Member
0 Kudos

Hi as far as i know... these fileds are related to PEXR IDOC.... do you have any scenario for that... maybe its the error from that scenario,

Former Member
0 Kudos

I used ORDERS.ORDERS05. and the error is in E1EDP01 MENGE.

Former Member
0 Kudos

Just try to use the method I have mentioned above... I have worked on similar kind of IDOC and used the similar mapping.....It worked.....

Former Member
0 Kudos

Also chk whether u using any kind of java mapping anywhere in the mapping.... maybe its the error from some other field.... is MEnge mapped to an UDF..

Regards

Former Member
0 Kudos

i have tried it already. same error occurs. thanks anyway. i'm running out of solutions

siddhesh_pathak4
Contributor
0 Kudos

Hello,

Check out the queue status for menge field in E1EDP01[2]/MENGE. This will give you the exact reason why it is failing.

Former Member
0 Kudos

@sir siddesh

There is no status to check since there are only 2 E1EDP01/MENGE.

1)E1EDP01/MENGE

2)E1EDP01[1]/MENGE

I'm really at a loss sir. It's the first time I encountered this kind of problem. the error said it was a 'SUPPRESSED FIELD'

former_member181985
Active Contributor
0 Kudos

what is your PI version.

If it is PI7.1, have you enabled XML validation? if so go with no validation...............

siddhesh_pathak4
Contributor
0 Kudos

Hello,

Forget about the 2 E1EDP01/MENGE. Did you check the queue foe menge field for that structure. what it says. is it fine with all the value. (for this copy your target structure in mapping and then check the queue). and yes please dont call Sir...:)

Former Member
0 Kudos

thanks everyone!!!

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

Hi,

I get an error message everytime a certain field is blank
java.lang.IllegalArgumentException: Cannot cast to float

This is the problem...the target node seems to be of type xsd:float and when such a field is passed a value the value should be in the [required format|http://books.xmlschemata.org/relaxng/ch19-77095.html]

If this is not followed then you are bound to get an error (as you are getting it now)

Float and other such types are not like xsd:string wherein even if you don't pass any value it's ok....

So when a value is passed it's fine and accepted by the xsd:float but it can't accept a blank/null.

So make sure that you always pass a value to the field or else if possibe change the type of the target node to xsd:string and then you can pass / avoid passing a value.....hope it helps.

If you need help in converting string to float then check this out:

Regards,

Abhishek

Edited by: abhishek salvi on Apr 17, 2009 10:21 AM

Former Member
0 Kudos

Hi...

If a is blank then B else a ... if this the requirement ... write a UDF like...

if(!a.equals(""))

return "true";

else

return "false";

Later you can use the mapping functions that are provided in Mapping.

Map the field u need to check to the UDF and using if-else route accordingly...

I hope this is what you needing....

Regards

justin_santhanam
Active Contributor
0 Kudos

Xavier,

are you using UDF? what's the logic you are doing? Can you explain your mapping here....

raj.

Former Member
0 Kudos

i have a UDF named default:

if (a.length() == 0){

return b;

}

return a;

if a is blank, i will use the string b.

if a is not blank, a will be used.

But even if I'm not using this UDF, there is still an error. I have tried mapping 'a' to MapWithDefault (1), but there's still an error.

thanks

Former Member
0 Kudos

hi,

try to map them with constant ..lets see if it works..

Regards,

Manisha

justin_santhanam
Active Contributor
0 Kudos

Xavier,

You won't get the error only when you use the UDF, even for the standard functions you might get error. For example when you are using SUM function, if you pass the string as the input then it will throw an error. So please check all your mapping element. If possible reply the structure here...

raj.

Former Member
0 Kudos

@manisha

I can't use constants because if there is a value for the variable, the variable should be used. thanks

@raj

yes i'm using it for SUM function but I placed MapwithDefault '0' after the variable that I'm using (a) and before the SUM function. It will still produce an error?How can I solve it sir Raj?

Former Member
0 Kudos

Hi,

compare value of variable with constant (blank) and if it true then map with constant else just map with same value like

a--


-
then--constant(default)

-Equals--


if -- -


target node

constant(blank)--- -else--a--


it is just graphical mapping..just try this..if it works...

Regards,

Manisha

justin_santhanam
Active Contributor
0 Kudos

Xavier,

As I said, could you please reply the source and target structure ?

BTW, plz don't call me sir .... I'm just one of your colleague/mate/buddy whatever but not sir

Thanks

raj.