cancel
Showing results for 
Search instead for 
Did you mean: 

In PI how do I convert the XML payload (input) to a text file and send out

Former Member
0 Kudos

I am extracting data from SAP and sending thru XI / PI to a file (non-sap system).

On the receiving end, I need the file to be a text file, with one row for each "FTZ_Row concatenated_data" tag in the input. It needs to be just a plain text file with no XML tags.

Currently the file gets one record which matches exactly to the XML payload below.

I want it to create a file that looks like this :

CONCATENATED DATA 1

CONCATENATED DATA 2

012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12

here is the payload going thru XI

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

- <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">

<FTZ_Row concatenated_data="CONCATENATED DATA 1" />

<FTZ_Row concatenated_data="CONCATENATED DATA 2" />

<FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />

</n0:FTZ_Concatenated_Row>

thanks

jay

Accepted Solutions (1)

Accepted Solutions (1)

mf_haq
Active Participant
0 Kudos

Hi Jay,

it's very simple u can do it.

your scenario is SAP--->XI-->File

just do one thing in Receiver CC...Message protocal as a -


FCC----


with Rgds,

MFH

Former Member
0 Kudos

thanks for the input but I am still having issues - I get an empty file when I use the content conversion option.

My payload coming into XI is :

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

- <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">

<FTZ_Row concatenated_data="CONCATENATED DATA 1" />

<FTZ_Row concatenated_data="CONCATENATED DATA 2" />

<FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />

</n0:FTZ_Concatenated_Row>

Here is the layout of my data type - I am using the same for input & output

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" targetNamespace="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone">

<xsd:complexType name="FTZ_Concatenated_Row">

<xsd:sequence>

<xsd:element name="FTZ_Row" maxOccurs="unbounded">

<xsd:complexType>

<xsd:attribute name="concatenated_data" type="xsd:string" />

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

I mapped these items : FTZ_Concatenated_Row & FTZ_Row & concatenated_data

I set up my content convesion with :

recordset structure FTZ_Row

FTZ_Row.fieldSeparator #

FTZ_Row.endSeparator 'nl'

I am not sure why the following row looks like this ??

<FTZ_Row concatenated_data="CONCATENATED DATA 1" />

I thought FTZ_Row would be one tag and "concatenated_data" would be another one.

any help would be appreciated.

I have read many entries/blogs/etc in SDN but and tried many different setups, but nothing is working.

thanks

Former Member
0 Kudos

Hi..

If your source and target structure is like below payload,

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

<ns0:MT_input xmlns:ns0="http://Test_CTS">

<FTZ_Concatenated_Row>

<FTZ_Row>CONCATENATED DATA 1</FTZ_Row>

<FTZ_Row>CONCATENATED DATA 2</FTZ_Row>

<FTZ_Row>012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12</FTZ_Row>

</FTZ_Concatenated_Row>

</ns0:MT_input>

Use FCC in the reciver communication channel.

Recordset STructure --- FTZ_Concatenated_Row

FTZ_Concatenated_Row.fieldSeparator -- 'nl'

FTZ_Concatenated_Row.endSeparator -- 'nl'

You will get the target file as below.

CONCATENATED DATA 1

CONCATENATED DATA 2

012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12

Former Member
0 Kudos

Create a EJB and include it in the File Communication Channel.

How to?

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60482ee6-32b2-2b10-fe92-a62bffc0...

Former Member
0 Kudos

Hi,

Solved?

Try with FCC parameters in the reciver communication channel:

Recordset STructure: FTZ_Concatenated_Row Or Recordset STructure: FTZ_Concatenated_Row,1

FTZ_Concatenated_Row.fieldSeparator : 'nl'

FTZ_Concatenated_Row.endSeparator : 'nl'

Abid

Answers (3)

Answers (3)

Former Member
0 Kudos

the issue was my input xml message was wrong; it was this format :

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

- <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">

<FTZ_Row concatenated_data="CONCATENATED DATA 1" />

<FTZ_Row concatenated_data="CONCATENATED DATA 2" />

<FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />

</n0:FTZ_Concatenated_Row>

once I changed the "concatenated_data" tag to a subelement instead of an attribute, the FCC worked as indicated in this chain.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi ,

Michal said you can achieve this one using FCC(File Content Converion) File receievr Communication Channel.

one more alternative is Develop XSLT Mapping in that select out put type is Text,you wil get out put in text format ,without using FCC,but in this case its not possible to see msg in Moni.

bets approch is go for FCC.

CheerS,

Raj

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

the easiest wat is to use content conversion with the file adapter

this will change the XML output to flat file output

there are tons of content conversion examples on sdn - blogs - just use a search

Regards,

Michal Krawczyk

Former Member
0 Kudos

Michal :

could you point me to a specific link/document which has details on how to do this ? I found documents about going from a text file to XMl but no XML to flat text file. Also the ones I have read don't have enough detail for me ... I have never used the file conversion option before so not sure where to start.

thanks

Former Member
0 Kudos

You can have a look at the below blog

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

I found the above just by searching "Receiver file content conversion",you could have tried the same:)

Thanks

Aamir