Skip to Content
0

How to read text file and convert into XML in HCI

Dec 18, 2017 at 06:50 AM

330

avatar image

Hi Experts,

There is a text file on SFTP, i want to read text file and convert into xml and pass the data to entities in ECC system.

But there is no option or feature similar to FCC of SAP PI/PO in HCI.

Kindly help me any groovy script or XSLT mapping would be helpful to convert txt to xml.

Thanks and Regrads,

Md.Thouheed


10 |10000 characters needed characters left characters exceeded

Hi Mohammad

There is no generic solution to the problem you're describing. If you were to show an example of the contents of the file, we would be able to offer some advice on how to code the translation in Groovy.

Regards,

Morten

0

Hi Morten,

Please find the below text file:

000451000206    INR0004    C              32000000024100017#SUCCESS
000451000206    INR0004    C              22000000024100017#SUCCESS
000451000206    INR0004    C              12000000024100017#SUCCESS

Expected XML Output: Max Length is Field 1: 16, Field 2: 3, Field 3: 8, Field 4: 1, Field 5: 15

<Root>
    <Field1>000451000206    </Field1>
    <Field2>INR</Field2>
    <Field3>0004    </Field3>
    <Field4>C</Field4>
    <Field5>              3</Field5>
    <Field6>2000000024100017</Field6>
    <Field7>SUCCESS</Field7>
</Root>
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sriprasad Shivaram Bhat
Dec 19, 2017 at 07:59 AM
0

Hello Mohammed,

If you are not familiar with Groovy scripting please refer to below blog will help you to achieve the same.

https://blogs.sap.com/2017/10/31/sap-cloud-platform-integration-hana-cloud-integration-hci-creating-file-field-fixed-length-to-success-factors-interface/

Regards,

Sriprasad Shivaram Bhat

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

Very Nice Blog,

Very Helpful , Thanks Sriprasad.

0