on 10-09-2008 12:58 PM
Hi All,
I have an issue in IDOC - DB scenario.
Source field is optional
Target field is mandatory in DB and defined it as Integer in XI [datatype is Numeric in stored procedure]
I mapped the source field in such way that if it is null, then map Constant(Gave null value) else do the necessary transformation and used the mapwithdefault(null) and mapped it to Target field.
This is working fine when there is some value in the source field, but if source field is empty, there is an error.
NumberFormat exception in CommunicationChannel....
Its unable to convert the null to numeric format. But from Database end, I tested through query analyzer by populating some null value into that field and its working fine by accepting the null value.
Any pointers in this..
Regards,
Srini
Closed.Changed the datatypes in Stored procedure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The is error is becausing you must be using FormatNumber in your mapping and when there is a null value in source field it throws the error.
You can solve this by writing an UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh,
Thanks for your response.
Yes We are using FormatNumber function..
Actually, the input element is (11,2) (Ex: -
11.20) Output should be (11.20).
To avoid those spaces we used Formatnumber as ( #.##) and now no spaces in the output.
As target is Mandatory, we used MapwithDefault in combination with Formatnumber...so ended up with error..
So you mean to say by writing UDF, we can resolve the trimming of spaces from the input field and at the same time we can insert the values to DB.
Regards,
Srini
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.