cancel
Showing results for 
Search instead for 
Did you mean: 

Message Transformation Bean not converting csv to xml

0 Kudos

Hello,

I have to transform CSV to xml in SFTP adapter. Although we can use content conversion but it was not working so i used Message Transformation Bean. File is getting picked up but i am getting error in mapping.. since the file is not getting converted to xml.

Error message : com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.,

Attached are screen shots for module used, can somebody please tell me where am i making mistake? Do i have to add/remove any parameters ?

Regards

Ankyy

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

Hello All,

I am closing this thread. Thank you for help.

Regards

Ankyy

former_member190293
Active Contributor
0 Kudos

Hi Ankyy!

You've missed the dot in parameter's name "Transform.Class".

One more question: do you need your header record in further XML processing?

Regards, Evgeniy.

manoj_khavatkopp
Active Contributor

Nice Catch.

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Ankiy,

Please check below :

But note MTB dose't has a option of Removing of RecordSet hence the XML converted by MTB dosne'nt match with your current structure you either need to change your source structure or you need to remove this Recordset via java/xslt before passing it to your mapping.

Br,

Manoj

0 Kudos

Thanks for the response Manoj... but somehow this is also not working.

manoj_khavatkopp
Active Contributor
0 Kudos

Can you please share the screenshot of your MTB. and also for the file which it is throwing error.

0 Kudos

Attached is file & screenshot.

I have tried with field separator as nl.

But nothing is working.

manoj_khavatkopp
Active Contributor
0 Kudos

What's the error you are getting ?

0 Kudos

mapping error.. since file is not getting converted to xml.

Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog., ApplicationRuntimeException: Runtime Exception when executing application mapping program

former_member190293
Active Contributor
0 Kudos

Hi Ankyy!

Why did you set 'nl' as field separator when you have comma separated values in your source file?

Regards, Evgeniy.

0 Kudos

Hi Evgeniy,

Since i want to send whole record line in single field, i have used field separator as 'nl'.

Regards

Ankyy

former_member190293
Active Contributor
0 Kudos

I guess that you have at least two fields in each of your recordsets: the key and the rest values.

Regards, Evgeniy.

0 Kudos

Key field is not required, i have added it because i have used it in Message Transformation Bean.

Please check attached images for csv input and expected xml input

Let me know some way to transform above csv file.

Regards

Ankyy

former_member190293
Active Contributor
0 Kudos

Hi Ankyy!

May be my understanding is wrong, but since you have recordset with occurence "*" in your source file you should use keys for correct processing. Or you should set definite count for each recordset.

Regards, Evgeniy.

Andrzej_Filusz
Contributor
0 Kudos

Hi Ankyy,

Are you sure your XML is encoded in UTF-8? If yes, then please check if there are any characters before: <?xml

Probably you have a problem with the BOM (byte order mark) - please check if there is a sequence of bytes: EF BB BF at the beginning of your XML file.

Could you request a file without any additional characters at the beginning of your XML?

Regards,

Andrzej

0 Kudos

Hi Andrzej,

Actually comma separated file from FTP is passing as it is into message mapping. Nothing is getting transformed into XML. So i am not sure.

Regards

Ankyy

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Ankyy,

Would you mind providing a Sample Data file which you are trying to pick.

Br,
Manoj

0 Kudos

Hi Manoj,

I have attached sample file. 1st line is the header line, rest are item lines. And i want convert it record wise(row wise).

Regards

Ankyy