Skip to Content
0

Handling flat files in SAP HCI

Jun 15, 2017 at 02:28 AM

184

avatar image

Hi Experts,

We have 4 outbound interfaces (IDoc -> File) & 1 inbound interface(File -> IDoc) already live in

SAP PI 7.3 dual stack where FCC is the message protocol in both outbound & inbound interfaces. We are replicating these in SAP HCI & I already imported service interfaces, IDoc structures to HCI. As mentioned in outbound interface we need to convert IDoc to flat file & in inbound interface flat file need to be converted to IDoc. My question can we handle flat files in HCI, if so kindly guide me how to achieve this using HCI?

Thanks,

Ramu.

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

2 Answers

Sriprasad Shivaram Bhat Jun 15, 2017 at 03:34 AM
0

Hello Ramu,

In SAP HCI FCC is not available.For converting flat file to XML structure you can leverage converter which supports conversion of delimited file to XML.

If you want to convert the file based on field length then you have to write groovy or JavaScript.

Regards,

Sriprasad Shivaram Bhat

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

Hi Shivaram,

We need to convert Flat file[CSV] to XML as well as XML to Flat file[CSV].Can you please elaborate on how to leverage converter for converting Flat file to XML & vice versa. Kindly share me the link or steps to be carried out to achieve this.

Thanks,

Ramu.

0
Sriprasad Shivaram Bhat Jun 15, 2017 at 04:07 AM
0

Hello Ramu,

Below will give you more details

https://blogs.sap.com/2016/01/14/hci-xml-to-csv-conversion-in-hci/

Also it would be great if you can search in our community since we are already having similar threads with solutions for converter.

Regards,

Sriprasad Shivaram Bhat

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

Hi Shivaram,

Our requirement can be handled perfectly by below blog but except one additional change.

https://blogs.sap.com/2016/01/14/hci-xml-to-csv-conversion-in-hci/

The modification what we need is both header names & values should be present inside " " just like below remaining all can be acheived by above blog.

Input Payload<?xml version=’1.0′ encoding=’UTF-8′?>

<Records>

<Line>

<Field1>ABC</Field1>

<Field2>123</Field2>

<Field3>XXX</Field3>

<Field4>567890</Field4>

</Line>

<Line>

<Field1>XYZ</Field1>

<Field2>456</Field2>

<Field3>YYYY</Field3>

<Field4>98765</Field4>

</Line>

</Records>

Output Payload"Field1","Field2","Field3","Field4"

"ABC","123","XXX","567890"

"XYZ","456","YYYY","98765"

Kindly suggest me on the steps to achieve this?

Thanks,

Ramu.

0