Skip to Content
0

Mapping in sap pi

Sep 19, 2017 at 07:50 AM

62

avatar image
Former Member

From an IDOC we are getting multiple SubLineItems in POSNR field and HIPOS field has one value i.e., 1st value of POSNR. When POSNR is equals to HIPOS the fields should not populate in the output. In my case the fields are populating with empty values. Basically the POSNR has multiple values it has to skip the first value. What are the logics i can use and implement in the mapping SAP PI.

Please suggest me to do this

Regards,

Kalpana

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Peter Wallner Sep 20, 2017 at 02:15 PM
0

Hello Kalpana,

Can you post a source XML and target XML what it should look like? Also, what mapping are you using - graphical or XSLT (I presume one of these two)?

Best regards,
Peter

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 21, 2017 at 11:36 AM
0

Peter,

Source is an IDOC and target is an XML file. I'm using graphical mapping.

I have attached the target schema in text format.



Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hello Kalpana,

Sorry, I can't help because we are not using graphical maps, only XSLT. I think you have to look into node funtions and be carefule with contect changes. Maybe the createIf function is worth looking into?

https://blogs.sap.com/2006/01/09/the-use-of-suppress-in-the-xi-30-graphical-mapping-tool/

Best regards, Peter

0
Former Member

Peter,

Do you any idea how i can map this,

ProductIdentification for each E1TXTH9[TDID = '0001']/E1TXTP9/TDLINE except the 1st one

Please suggest me

Regards,

Kalpana

0

Hello Kalpana,

Sorry, my late answer. In XSLT I would try something like this:

<xsl:apply-templates select="E1TXTH9[position()> 1 and TDID = '0001']/E1TXTP9/TDLINE"/>

and then the actual template:

    <xsl:template match="E1TXTH9[position()> 1 and TDID = '0001']/E1TXTP9/TDLINE">
        <TARGETNODE>
            <xsl:value-of select="'select some value from the IDoc'"/>
        </TARGETNODE>
    </xsl:template>

With "position() > 1" it should only consider the second E1TXTH9 and up.

Best regards,

Peter

0
Former Member

Thanks for your response peter.

I want to know how to do in graphical mapping, because i'm using graphical mapping here.

Please help me out how to resolve this.

Regards,

Kalpana

0