Skip to Content
avatar image
Former Member

mapping issue in customised idoc

Hi experts,

I have facing a mapping issue, so need input.

my scenerio is from idoc(z) to http. This idoc contains an additional segment which contains pdf details and PDF data in base 64. this segment is added under E1EDK01.

Now, I have requirement that I need full Idoc content to be passed to a field in xml, but that content should not contain pdf segement(ZCXTXMLEN).

Though I have made a logic but it's not working. find attached images for reference.

Thanks in advance.

pi.png (19.7 kB)
pi1.png (29.1 kB)
pi3.png (33.8 kB)
pi4.png (15.0 kB)
pi.png (19.7 kB)
pi1.png (29.1 kB)
pi3.png (33.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 07, 2017 at 06:33 AM

    Hi Nunu!

    First, you can't put one xml tree inside the other using standard functions of graphical mapping until it's wrapped with CDATA tags.

    If you need to put one XML structure inside the other, you could use approach described in this blog:

    https://blogs.sap.com/2012/11/05/message-mapping-play-around-with-target-structure/

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 07:04 AM

    Hi Nunu!

    To fullfill your requirement I'd suggest using XSL transformation. For example, this template

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:template match="/">
            <OutputMessage>
                <IDocData>
                    <xsl:apply-templates/>
                </IDocData>
            </OutputMessage>
        </xsl:template>
        <xsl:template match="*">
            <xsl:copy>
                <xsl:apply-templates select="(@* | node())[local-name() != 'ZCXTXMLEN']"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="@*">
            <xsl:copy/>
        </xsl:template>
    </xsl:stylesheet>

    puts contents of your IDoc inside the IDocData element of target message removing unwanted element.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 07, 2017 at 05:31 AM

    Try using UDF and make it simple :

    IDOC(RETURN as XML)--->UDF ( Remove everything from start and end of xml tag <ZCXTXMLEN>)--->Target Node.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded