cancel
Showing results for 
Search instead for 
Did you mean: 

Spilit on Target message

Former Member
0 Kudos

Hi Experts,

I would like to spilit the target SOAP message depends on the number of line items from the source side.

For example, total source message/lineitem is 5000. I have to send 500 lineitem in one SOAP message, so I have to create 10 Soap messages.

Could you please suggest me, how to do it thro' Graphical mapping?

Thanks

Sara

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Why dont you impkement same logic at sender side it self? i would prefer doing at sender system.

you need count number of records then splitinjg records , you required UDF for this with multi mapping concept.

Former Member
0 Kudos

Thanks for your response.

Could you please guide me how to do it thro' UDF?

Regards

Sara

Former Member
0 Kudos

Hi Sara,

You may use 1:n mapping and split the messages in graphical mapping. You will have to use enhanced interface determination for same.

You will have to use UDF with context type.

Loop on all the items and add context change after every 500 line items.

It will look something like this (there might be syntax errors):

for (i =0 ; i< a.size, i++)

{

result.add(a[i]);

if (i mod 500 = 0 )

  result.add(ResultList.CC);

}

Regards,

Beena.

Former Member
0 Kudos

Thanks for your response Beena.

Source(JDBC) and Target(SOAP) side, I have only one message structure. Is it fine?

I have to use the mentioned UDF for the root node of the target structure right? Will it automatically creates the n number of Target SOAP messages? Can we check this in Message mapping testing(test tab) itself?

Regards

Sara

former_member609026
Participant
0 Kudos

Hi Sara,

Hope the below link can help you.

http://wiki.sdn.sap.com/wiki/display/XI/Split+Mapping+using+UDF

Regards,

Pradeep A.

rajasekhar_reddy14
Active Contributor
0 Kudos

that is fine, use multi mapping and map to root . it should work.

Answers (1)

Answers (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Hi, the other and i think the best option is to create an additional XSLT mapping. below you will find and example of a mmaping i needed to create to split an WPUUMS01 IDoc

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://spsa.com/POS/DailySales">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="ns1:mt_SalesValidation_response">

      <WPUUMS01>

       <xsl:for-each select="row[position() mod 500 = 1]">

         <IDOC>

            <xsl:attribute name="BEGIN">

               <xsl:value-of select="1" />

            </xsl:attribute>

            <EDI_DC40>1

              <SNDPRN>

       <xsl:value-of select="../OUT_WERKS"/>

              </SNDPRN>

            </EDI_DC40>

            <xsl:for-each select=".| following-sibling::row[position() &lt; 500]">

               <E1WPU01>

                  <xsl:attribute name="SEGMENT">

                     <xsl:value-of select="1"/>

                  </xsl:attribute>

                  <BELEGDATUM>

                     <xsl:value-of select="../OUT_ERSDA"/>

                  </BELEGDATUM>

                  <BELEGWAERS>PEN</BELEGWAERS>

                <E1WPU02>

     <xsl:attribute name="SEGMENT">

      <xsl:value-of select="1"/>

      </xsl:attribute>

     <QUALARTNR>EANN</QUALARTNR>

     <ARTNR>

               <xsl:value-of select="EAN11"/>

     </ARTNR>

     <VORZMENGE>-</VORZMENGE>

     <UMSMENGE>

               <xsl:value-of select="TOT_CANTIDAD"/>

     </UMSMENGE>

     <UMSWERT>

      <xsl:value-of select="TOT_VTA"/>

     </UMSWERT>

                </E1WPU02>

                 </E1WPU01>

              </xsl:for-each>

         </IDOC>

     </xsl:for-each>

      </WPUUMS01>

   </xsl:template>

</xsl:stylesheet>

also take allok to this link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3...

http://scn.sap.com/docs/DOC-3535

Hope it helps

Rodrigo P-.

Former Member
0 Kudos

Hi Experts,

I have created the UDF logic as per your suggestion.

Source side - I have one message

Target side - I have one message but change the occurance to 0 to unbounded.

In the Target output, I get the message like below.

<Messages>

<Message1>

<Target rootnode>

  <LineItemNode>

     <Lineitems>

     <LineItems>

  <LineItemNode>

</Target rootnode>

<Target rootnode>

   <LineItemNode>

      <LineItems>

      <LineItems>

    </LineItemNode>

</Target rootnode>

</Message1>

</Messages>

In above message Target rootnode level spilit occurs but it displayed in the same/one message. Is it possible to create separte messages for each Target SOAP rootnode spilit message.

Do I need to change anything in ID objects ( Receiver determination or Interface Determination)?

Thanks  & Regards

Sara

gagandeep_batra
Active Contributor
0 Kudos

did you check in interface mapping ?

rajasekhar_reddy14
Active Contributor
0 Kudos

Multi mapping works this way only, how many messages were created in Moni? only one?