cancel
Showing results for 
Search instead for 
Did you mean: 

XML to XLS file converting in sap cpi using standard or groovy

former_member229127
Participant
0 Kudos

HI All,

Can you help to convert the xml to xls file which i need to post in the sftp in sap cpi.

Regards,

Sandhya

Accepted Solutions (0)

Answers (2)

Answers (2)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sandhya,

Please refer below blog and you need to use Apache POI libraries to generate XLS.

https://blogs.sap.com/2020/10/06/converting-xls-file-to-xml-format-with-cpi-groovy-script/

https://howtodoinjava.com/java/library/readingwriting-excel-files-in-java-poi-tutorial/

Regards,

Sriprasad Shivaram Bhat

former_member229127
Participant
0 Kudos

Hi sriprasadshivaramabhat ,

The blog which you have provided is XLS to XML but i need xml file to XLS that in groovy do you have any code for it?

Regards,
Sandhya

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

You can use a converter to convert XML->CSV and then name the file accordingly to xls.

https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/902522209e7546f89c3c52ad018...

Thanks,
Marty

former_member229127
Participant
0 Kudos

Hi marty.mccormick ,

Are you sure this way it will work ?

Regards,

Sandhya

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sandhya

Sorry, I should have added some more details. Yes, if the requirement is to generate an xls file you would need to use the libraries linked by Sriprasad. What I should have added is that often times my customers just want a file that they can open in Excel, so using a csv file meets their requirements (and once you open the csv you can save it as xls).

Thanks,
Marty