Skip to Content

CSV to XML Conversion in SAP CPI

Dear Experts,

We are trying to convert a CSV file (from a SFTP location) to XML format using CSV to XML Convertor in CPI.

But facing errors while conversion, as the headers of CSV file is empty for some columns in between. (Duplicate Headers / No. of Elements mismatch).

Any suggestions on how to avoid/eliminate the errors?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 30, 2020 at 04:53 PM

    Hello Sarangarajan,

    First part is you need to align with your sender system to make sure column data appears ( blank some thing like 1,2,,4,5, ) otherwise you need to know definite set of confirmation from sender side what might come blank & in which position data should be there ( very similar to field fixed length ).

    Without knowing which column comes blank or which field does not value and also no placeholder its not possible to come to conclusion on technical solution side ( whether to use Standard Converter or Groovy script ).

    Regards,

    Sriprasad Shivaram Bhat

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sriprasad,

      Here's my model input as a sample (Highlighted are headers);

      CSV files will be coming as;

      #|EmployeeID||||Persontype|EmployeeName||Place... ( | as separator)

      File may contain 1 lakh records of 100+ fields among which 50 columns will have empty headers. Note: Fields values will be in a random manner not in sequential.

      Could you suggest me further.

      sample-input.png (5.4 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.