cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice for converting FLAT file to XML in CPI

emaaarrr
Explorer
0 Kudos

Hello, I'm a newc to this community, and I need to convert a flat file (like the example provided below) into XML format in CPI. I've found various blogs that suggest using Groovy scripts, while others recommend a combination of Palette functions and Groovy scripts. I'm unsure about the best practice to follow in CPI for handling this kind of scenario.

emaaarrr_0-1712655743532.png

Looking for assistance from the community to meet this requirement using the best practices in CPI. Any assistance would be highly appreciated.

Thanks!

View Entire Topic
ag3silaus
Participant
0 Kudos

Hello @emaaarrr ,

Welcome to the SAP community, particularly the Cloud Integration segment! Regarding your query, you can find a comprehensive answer in this informative blog post: cpi-convert-flat-file-to-xml . If you require assistance with Groovy scripting in your scenario, feel free to reach out. I'm here to help.

Best Regards,

Burak

emaaarrr
Explorer
0 Kudos

Hi @ag3silaus,

Thanks for getting back to me. After reviewing your blog, it seems that we're currently treating the incoming message as a String, which will store the entire payload in memory. However, I need to handle large amounts of FLAT file data, which could potentially lead to processing time issues. Is it possible to use a Reader to read the data line by line within the same code? If so, could you please provide an example for reference?

Thanks and regards,
Emar