Skip to Content
0

Change content of File created by SFTP Adapter

Dec 04, 2017 at 12:57 PM

54

avatar image

Hi guys,

we are working on an SFTP Adapter which sends FI data mediums (Transaction FDTA) to another Company. The data itself comes from an ABAP Proxy, which passes the content of the data medium to the PI. The problem is, that the file which gets created by the SFTP adapter contains the whole payload of the PI message, but it should only contain one specific Segment of the message.

Is there a way to write only one Segment of the incoming message into the file which gets created by the SFTP Adapter?

This is the message which gets created by the ABAP Proxy:

And this is the result on the SFTP Server:

As you can see, we have two Problems right now:

1) the whole message gets written into the file instead of just the <content> segment

2) there seems to be some kind of conversion which gets applied to the content segment

Help would be appreciated.

Cheers, Klaus

cfdtg.png (16.6 kB)
tpqaj.png (26.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Ariel M. Bravo Ayala Dec 05, 2017 at 11:15 AM
1

Klaus,

About your points:

1.- As Iñaki mentioned, you will require something like a mapping that extract the content of the tag you require.

2.- The conversion you are mentioning, is nothing else than escaping XML's special characters. Basically, you are sending an XML inside another XML. Hence, the inner XML needs to be escaped. If look carefully, the rendered XML you are seeing in the first screen, show the inner XML "not rendered".

For solving both things, you can use an XSLT transformation like this one:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform">
   <ns0:output method="xml" indent="yes"/>
   <ns0:template match="node() | @*">
      <ns0:copy>
         <ns0:value-of select="*/content" disable-output-escaping="yes"/>
      </ns0:copy>
   </ns0:template>
</ns0:stylesheet>

That XSLT will select the content tag and place it unescaped into a new document.

Best,

Ariel Bravo Ayala

Share
10 |10000 characters needed characters left characters exceeded
Iñaki Vila Dec 04, 2017 at 01:44 PM
1

Hi Klaus,

I think your are not using ESR development. You should use an operation mapping with a XSLT to extract the XML that you need from the tag.

The configuration can remain equals but you should point the new operation mapping.

Regards.

Share
10 |10000 characters needed characters left characters exceeded
Klaus Kronawetter Jan 22 at 10:16 AM
0

Thanks guys, we solved it with a Java mapping.

Share
10 |10000 characters needed characters left characters exceeded