Skip to Content
avatar image
Former Member

Adding a custom XML header to invoice XML files going to Seeburger AS2 receiver partner

Hello Experts,

The current configuration in discussion is (IDOC-XML)File to AS2. The interface is an Integrated Configuration(ICo ) and is up and running successfully.

Now we need to generate the XML according to client's new requirement.

I am able to generate the XML with <?xml version="1.0" encoding="UTF-8" ?> as Header but client requires it like this

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

<?kliformat="INV"sender="PEROXY"receiver="006903702"?>

<IDOC BEGIN="1">

<EDI_DC40SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>522</MANDT>

.

.

.

and here value of receiver will change dynamically for every xml genaration. How it make as dynamical and how can I achieve this.?

Plz guid me...

I have already checked

https://archive.sap.com/discussions/thread/1760177

But so far we are not using any mapping since there was no transformation involved. Do we have any adapter module to be used in AS2 adapter to transform the output xml.

Kindly provide your inputs

Thanks and Regards,

Shikha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 26, 2017 at 04:59 PM

    Shikha,

    There is no standard way to do this you need to go for xslt or java mapping.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • May 02, 2017 at 01:55 PM

    Hi Sikha,

    As Manoj said only option is to use XSLT or JAVA mapping.

    Sample XSLT is like below. You can make it dynamic as per your requirement. Java mapping will also be very easy. Take all data using InputStream, then take that into a String. Replace the xml start annotation with the custom one as per your requirement and create output using OutputStream.

    If you are using pass-through scenario then to add JAVA/XSLT just create a dummy structure and put the same in OM and import JAVA/XSLT mapping.

    Sample XSLT -

    http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/*">
    http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 file:///H:/XML%20spy/pain.001.001.03.xsd">
    <xsl:call-template name="identity"/>
    </Document>
    </xsl:template>
    <xsl:template name="identity">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>

    Thanks,

    Apu

    Add comment
    10|10000 characters needed characters exceeded