cancel
Showing results for 
Search instead for 
Did you mean: 

CSV to XML Conversation in SAP HCI

former_member302452
Participant
0 Kudos

Dear Experts,

I’m expecting a XML structure as output for my CSV input. However I’m getting XML structure whereas the line items in sub-hierarchy are missing.
Please read the below explanation for further information.
Please correct me if the CSV input I’ve given is incorrect.

All helpful replies will be appreciated.

Explanation:

Working in HCI on a iflow, in which input is a CSV file. So in the iflow, i put a SFTP server to get the file, then a converter step for CSV to XML converter.

In the csv file, the data is something like:

Header 1 2 3

LineItems 12 3 4

LineItems 12 3 4

Header 1 2 3

LineItems 12 3 4

LineItems 12 3 4

Meaning multiple records header and Line items is sub hierarchy.

Created XSD for the above XML manually or from online tool like freeformatter.com and I can see the structure of the file in hierarchy as:

Then imported that XSD in the integration project in HCI where the above iflow is created.

Then path to target element in XSD : /root/row

Record marker in csv - empty

Field separator in csv – comma

Regards,
Md Thouheed.

balazsbence95
Active Participant
0 Kudos

Hi,

Please, remove tag SAP Cloud Integration for data services and address this issue to the Process Integration community using their tag.

Thank you,
Bence

Accepted Solutions (0)

Answers (4)

Answers (4)

Sriprasadsbhat
Active Contributor
0 Kudos
former_member302452
Participant
0 Kudos

Hello Sriprasad,

Can you please send me few links to understand open CSV.

I will try to get help to work on groovy srcipt.

Thanks for your time.

kavya_01
Explorer
0 Kudos

Hi,

Even i have a very similar requirement, Can you please help me with the groovy scipt?

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mohammad ,

Its not possible to generate the output in the format you have given using Standard CSV to XML convertor.

You have to write Groovy Script to achieve the same[ You can use freely available package like OpenCSV ].

Regards,

Sriprasad Shivaram Bhat

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mohammed,

It would be great if you can mention some logical input(CSV where we can differentiate fields and lines ),expected output(try to put the values from CSV mentioned) and what output you are currently getting.

Regards,

Sriprasad Shivaram Bhat

former_member302452
Participant
0 Kudos

Hello sriprasad,

In the CSV file, input data is something like:

'm getting output XML structure like:

I’m expecting a XML structure as output:

Please correct me if the CSV input I’ve given is incorrect.

Then path to target element in XSD : /root/row