Skip to Content
0

SAP PI/PO message mapping

Jun 11, 2017 at 05:25 AM

119

avatar image
Former Member

Hi All,

I have provide the source and expected target structure below. Can any one please tell the mapping for the same.

Root Node at target has to be repeated for each records at source.

FYI - At the source end i am receiving flat file and converting it into xml using Message Transform beam in sender channel.

Please let me know the mapping and if any UDF is required to achive this output.

capture.jpg (17.8 kB)
capture1.jpg (56.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Evgeniy Kolmakov Jun 11, 2017 at 03:42 PM
0

Hi Vini!

I guess the most suitable approach for this kind of transformation is using XSL transformation. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <ns1:MT_Target xmlns:ns1="http://tempuri.org">
            <xsl:apply-templates select="//Record"/>
        </ns1:MT_Target> 
    </xsl:template>
    <xsl:template match="Record">
        <Root>
            <Header>
                <Field1>Constant</Field1>
                <Field2>Constant</Field2>
                <xsl:for-each select="./*">
                    <Record>
                        <Name><xsl:value-of select="local-name()"/></Name>
                        <Value><xsl:value-of select="."/></Value>
                    </Record>
                </xsl:for-each>
            </Header>
        </Root>
    </xsl:template>
</xsl:stylesheet>

Regards, Evgeniy.

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

Hi Evgeniy,

Thanks for the reply.

The XSL transformation works fine. But for Header fields (Field1 and Field2) i have to read the RFH2 headers through JMS channel and pass the values.I think this would be relatively easy if the transformation is achieved via graphical mapping.

I am using duplicate sub tree to replicate "Record" nodes at target structure.But how to replicate "root" node for every Record at Source side.

So can you please let me know how to achieve this via graphical mapping.

0
avatar image
Former Member Jun 12, 2017 at 09:59 AM
0

Hi Vini,

Where are you facing the issue in Graphical mapping? It's a very simple straight forward graphical mapping.

Thanks,

Apu


wmrto.png (104.4 kB)
ovvvy.png (147.9 kB)
Share
10 |10000 characters needed characters left characters exceeded