Skip to Content

Save XML file into FTP PI

Hi Experts,

I'm facing a little problem.

I need to save a xml file into a ftp.

The communication is already done and works perfectly.

My Payload, is send from ECC SAP via RFC, and is like that:

But the .xml saved in ftp when opened is like this:

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

<ns1:MT_InvoiceToDescartes xmlns:ns1="http://www.brf.net/ediEurope/AperakToDescartes"><XML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;

&lt;INVOICES&gt;

  &lt;Envelop&gt;

    &lt;senderId&gt;123456&lt;/senderId&gt;

    &lt;recipientId&gt;123457&lt;/recipientId&gt;

    &lt;controlNumber&gt;&lt;/controlNumber&gt;

    &lt;dateTime&gt;20150903091225&lt;/dateTime&gt;

    &lt;testIndicator&gt;1&lt;/testIndicator&gt;

    &lt;messageType version=&quot;1&quot;&gt;INVOICE&lt;/messageType&gt;

  &lt;/Envelop&gt;

&lt;/INVOICES&gt;</XML></ns1:MT_InvoiceToDescartes>

But what I realy need, is the file was only the data that is into <XML> and not converted, like this:

<?xml version="1.0" encoding="iso-8859-1"?>

<INVOICES>

  <Envelop>

    <senderId>123456</senderId>

    <recipientId>123457</recipientId>

    <controlNumber></controlNumber>

    <dateTime>20150903091225</dateTime>

    <testIndicator>1</testIndicator>

    <messageType version="1">INVOICE</messageType>

  </Envelop>

</INVOICES>

I Need to do something in the Message Mapping or configure something more in the Channel Communication File?

I read some discusions, but I don't know what is applied to my case.

Thanks in advance.

Sem título.png (72.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Sep 03, 2015 at 02:20 PM

    Hello Neto

    Just open you message type, there you find XML Namespace option and just remove the namespace. save and activate.

    Now you try your scenario and check.

    Regards

    Amarnath..

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 03, 2015 at 05:27 PM

    Try Changing the encoding

    <?xml version="1.0" encoding="UTF-8"?>-I guess this is in the XML written in the FTP.

    <?xml version="1.0" encoding="iso-8859-1"?>- what you need?

    Add comment
    10|10000 characters needed characters exceeded

    • Just to clarify.

      My interface is an RFC to File

      There is a field exporting calling I_XML, that is a string.

      In this field I send an XML, in case this XML:

      <?xml version="1.0" encoding="iso-8859-1"?>

      <INVOICES>

        <Envelop>

          <senderId>123456</senderId>

          <recipientId>123457</recipientId>

          <controlNumber></controlNumber>

          <dateTime>20150903091225</dateTime>

          <testIndicator>1</testIndicator>

          <messageType version="1">INVOICE</messageType>

        </Envelop>

      </INVOICES>

      I Need only this go to the file, nothing more or nothing different, exact this.

      But during the mapping and process of the interface, somethng occurs that modify completly my string.

      So, the file in ftp is this:

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

      <ns1:MT_InvoiceToDescartes xmlns:ns1="http://www.brf.net/ediEurope/AperakToDescartes"><XML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;

      &lt;INVOICES&gt;

        &lt;Envelop&gt;

          &lt;senderId&gt;123456&lt;/senderId&gt;

          &lt;recipientId&gt;123457&lt;/recipientId&gt;

          &lt;controlNumber&gt;&lt;/controlNumber&gt;

          &lt;dateTime&gt;20150903091225&lt;/dateTime&gt;

          &lt;testIndicator&gt;1&lt;/testIndicator&gt;

          &lt;messageType version=&quot;1&quot;&gt;INVOICE&lt;/messageType&gt;

        &lt;/Envelop&gt;

      &lt;/INVOICES&gt;</XML></ns1:MT_InvoiceToDescartes>

      Note that the values of the fields are the same, but it included the encoding, and substitute the '<' '>' by '&lt;' and '&gt;', and other things.

      I don't know, what i need to do to make PI don't modify the string, and save only the string I send.

      To be more exactly, this is my Message Mapping

      My CC File is this:

      Thanks for response Amarnath Mand Raghuraman Sritharan.

      And sorry for my english, I'm still learning.

      Image01.jpg (50.3 kB)
      Image02.jpg (95.9 kB)
  • avatar image
    Former Member
    Sep 03, 2015 at 06:57 PM

    Hi,

    Try Changing the Transfer Mode(Target Tab) & File Type(Processing Tab) as "Binary" and Check

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 03, 2015 at 08:36 PM

    Antonio,

    If input xml = output xml. Remove Operational Mapping from Interface determination or ICO. i.e. no message mapping is required/executed. Test the interface end to end.

    If you want some transformation (input xml != output xml), then use CopyXML feature in message mapping.

    SAP PI 7.1 Mapping Enhancements Series: Copy XML Subtree


    ID.PNG (60.2 kB)
    Add comment
    10|10000 characters needed characters exceeded