/scripts/ahub.form.attachments.js
0

Issue with SCPI - CSV to XML converter

Jun 27, 2017 at 07:39 AM

222

avatar image

Hi Experts,

My scenario is SFTP->Odata APIs (in SuccessFactors) via SCPI. I have a csv file with header so using "CSV to XML converter" to get required XSD structure and map it to Odata structure.

My CSV input is as below :

EmpID,first name, last name, date of birth, marital status

V001,Jane,Auston,22/01/1976,M

V002,Amy,Toogood,01/11/1960,M

Desired Output :

<?xml version="1.0" encoding="UTF-8"?>

<Personal_MT>

<Personal>

<EmpID>V001</EmpID>

<first name>Jane</firstname>

<last name>Auston</last name>

<date of birth>22/01/1976</date of birth>

<marital status>M</marital status>

</Personal>

<Personal>

<EmpID>V002</EmpID>

<first name>Amy</firstname>

<last name>Toogood</last name>

<date of birth>01/11/1960</date of birth>

<marital status>M</marital status>

</Personal>

</Personal_MT>

I have been following blog https://archive.sap.com/discussions/thread/3958677

but I am still getting error "

java.lang.IllegalStateException: Element name [] not found in provided XML schema file"

I have script in my iflow and have tried all the combinations of Xpath in the scenario. Can you please help me here?

Cheers,

Pratibha

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sriprasad Shivaram Bhat Jun 28, 2017 at 05:18 AM
2

Hello Prathiba.

I have tried the above scenario its working without any issues.

Input Data:

Field1,Field2.Field3,Field4,Field5
V001,Jane,Auston,22/01/1976,M
V002,Amy,Toogood,01/11/1960,M

Integration Process Configuration:

Schema Used:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Personal_MT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Personal" maxOccurs="unbounded" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="EmpID"/>
              <xs:element type="xs:string" name="firstname"/>
              <xs:element type="xs:string" name="lastname"/>
              <xs:element type="xs:string" name="dateofbirth"/>
              <xs:element type="xs:string" name="maritalstatus"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Output Data:

Hope it helps you.

Regards,

Sriprasad Shivaram Bhat


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

Thank you very much for looking into this for me. Error that I was seeing was from Odata services and after maintaining proper sequence of upsert I managed to successfully create employee in SuccessFactors but your response was a gerat help.

I am closing the thread now.

Thanks again !

Cheers,

Pratibha

0
Sriprasad Shivaram Bhat Jun 27, 2017 at 09:05 AM
1

Hello Pratibha,

It is not required have script to remove the header.

Use below configuration it should work for your requirement.

Regards,

Sriprasad Shivaram Bhat


Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

Thank you for your prompt reply. My error has changed to "null object loaded from local variable 'asList' " so I am guessing it has passed the converter step.

I really appreciate quick turn around.

Cheers,

Pratibha

0

Hello Pratibha,

Good to know.You can check your MPL to know about in which step error occurred .Please close the thread if error related to Converter is resolved.

Regards,

Sriprasad Shivaram Bhat

0
Sriprasad Shivaram Bhat

Hi Sriprasad,

I had to reopen the link as in MPL, it shows "converter" step is not successful yet. I am attaching log for your reference and screen shot of my step as well.

Could you please let me know what could be the problem?

Cheers,

Pratibha

log.txt

log.txt (3.1 kB)
capture.jpg (52.1 kB)
0

Thank You Sriprasad.

I am closing the thread now.

Cheers,

Pratibha

0
Skip to Content