cancel
Showing results for 
Search instead for 
Did you mean: 

SAP_XI_IDOC/IDOCFlatToXmlConvert, java.lang.NumberFormatException

0 Kudos

Hi,

I am getting the below exception when I tried to convert IDoc Flat File to IDoc XML using the module "SAP_XI_IDOC/IDOCFlatToXmlConvert" in sender File adapter.

Exception:

Module Exception 'com.sap.aii.af.idoc.exception.IDOCModuleException' found, cause: java.lang.NumberFormatException: For input string: ""

I have successfully uploaded and created the IDoc with the same file from WE19 transaction.

Any idea about this Exception.

Thanks,

Krishnaraju.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member184789
Active Contributor
0 Kudos

Hi,

I am facing the same issue. Could you please let me know how you resolved it. It fails in Sender channel itself, so there is no question of using any format number in mapping.

0 Kudos

Adarsh,

Is the source system is an SAP system? Could you post the file to check the format of the file. As said in the blog we need to have the format maintained to transform IDoc flat files into XML files.

"

Hi Li,

We have over come the number format exception by placing unique identifier in place of Idoc number and segment relations ships.

Module is successfully converting the IDoc Flat file with multiple Idocs, we dont have this limitation in this module.

The limitation is in the format of the source file. The flat file should contain unique identifier in place of IDoc and Parent and child node relation ship should explicitly mentioned in the IDoc flat file. Without these explicit parameters Module is not converting IDoc flat file into IDoc XML.

Without mentioning these explicit parameters, WE19 trasaction is successfully uploading the Idocs.

I think Java module is considering the unique relation ship by taking these parameters and ABAP program is reading the file in sequential way and creating the IDocs by breaking the file whenever it encounters EDIDC segment.

If the source system is not a SAP system, then it would be a problem using this module to convert Falt file into IDoc XML.

"

Thanks,

Krishna.

Former Member
0 Kudos

Hi Krishna,

The exception clearly shows that there is an issue while formatting the Number. Use Formatnum function.

Thanks,

Former Member
0 Kudos

Hi, Krishnaraju.

Your log error is clear .... you have a field that must be numeric and, in your file, it's null.

Can you verify your input file?

Verify also that fields MANDT, DOCNUM, SEGNUN, PSGNUM and HLEVEL are informed so , they aren't irrelevant but obligatories.

Regards,

Carme

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

You have used the arithmetic function format number and you are passing a string input of "" which would result in a mapping error.

Hope this helps,

Mark