on 09-07-2010 7:36 AM
Hi ALL,
I have a requirement were have to map between the idoc and xsd.
the problem I'm facing while mapping is the data type conflict. since both side(source and target) are standard, so can't change the data type .
the source is a string and target side we have decimal.
we are mapping source_element(string) to dest_element(decimal) and error mapping not possible.
so if anyone know the solution for this please let me know.
Thanks in Advance,
Lalit
No matter what you have in XSD, the XML representation of any type is a String.
So all you have to do is to make sure that your target has correct format 1234.56
When your input value has another foramt like 1,234.56 or 1.234,56 you can have the correct output with easy string manipulations (replaceString)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can write a UDF to do this for you.
Execution type: Single values.
Under Signature variable:
Argument var1 string
Code:
String s = var1
try
{
float f = Float.valueOf(s.trim()).floatValue();
}
catch (NumberFormatException nfe)
{
System.out.println("NumberFormatException: " + nfe.getMessage());
}
return f;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the exact error you are getting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First convert string to decimal using UDF,then map UDF out put to target.
search in google for java code to convert string to decimal.
or
if your bussiness people accpets string value at target side means,change xsd filed type to string in XSD,this will solve your problem too..
but i prefer first one.,
Regards,
raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.