on 04-17-2009 5:00 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Xavier,
are you using UDF? what's the logic you are doing? Can you explain your mapping here....
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
@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?
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.