cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to use Splitbyvalue in complexe structure

Former Member
0 Kudos

Hello Gurus,

I'm trying to make the following mapping.

Z_DELIVERY_DATE  (1 :1)

    IT_DELDATE         (1 :1)

          ITEM  (0:unbounded)

                KUNNR (0:1)

                DELDAT (0:1)

                TYPTR    (0:1)

MT_DELIVERY_DATE (1:1)

      deliveryCalendar  (1:1)

            ourRef              (1:1)

            client                (0:unbounded)

                  clinr            (1:1)

                   strdate      (0:unbounded)

                       date       (1:1)

                       type       (0:1)

Here is the exemple that I have, and the expected result.

<IT_DELDATE>

      <item>

<KUNNR>0000001499</KUNNR>

<DELDAT>2013-02-07</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001499</KUNNR>

<DELDAT>2013-02-08</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001499</KUNNR>

<DELDAT>2013-02-11</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001802</KUNNR>

         <DELDAT>2013-02-06</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001802</KUNNR>

<DELDAT>2013-02-08</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001803</KUNNR>

         <DELDAT>2013-02-05</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

      <item>

<KUNNR>0000001803</KUNNR>

<DELDAT>2013-02-06</DELDAT>

         <TYPTR>1</TYPTR>

      </item>

   </IT_DELDATE>

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

<ns1:MT_DELIVERY_DATE>

   <deliveryCalendar>

<ourRef>1234567890128</ourRef>

      <client>

<clinr>0000001499</clinr>

         <strdate>

<date>2013-02-07</date>

<type>1</type>

         </strdate>

         <strdate>

            <date>2013-02-08</date>

<type>1</type>

         </strdate>

         <strdate>

<date>2013-02-11</date>

<type>1</type>

         </strdate>

      </client>

      <client>

         <clinr>5425032171019</clinr>

         <strdate>

<date>2013-02-06</date>

            <type>1</type>

         </strdate>

         <strdate>

<date>2013-02-08</date>

            <type>1</type>

         </strdate>

      </client>

      <client>

<clinr>5425032171330</clinr>

         <strdate>

<date>2013-02-05</date>

            <type>1</type>

         </strdate>

         <strdate>

<date>2013-02-06</date>

            <type>1</type>

         </strdate>

      </client>

</deliveryCalendar>

</ns1:MT_DELIVERY_DATE>

I have made a lot of test with SpliByValue, but I never obtain this result.

Someone can help me.

Thanks and regard.

JC

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please use the below logic .

kunnr-->removecontext-->sort-->splibyvalue(valuechange)-->collapsecontext-->client

kunnr-->removecontext-->sort-->splibyvalue(valuechange)-->collapsecontext-->splitbyvalue(eachvalue)-->clinr

kunnr-->removecontext-->sort-->splibyvalue(valuechange)-->strdate

----------------------------------------------------------------------

kunnr-->remove context  -->sortbykey------------------------------formatbyexample-->

DELDAT-->remove context/                                            /

kunnr-->removecontext-->sort-->splibyvalue(valuechange)-/

-->splibyvalue(eachvalue)-->date

-------------------------------------------------------------------------------------

kunnr-->remove context -->sortbykey------------------------------ formatbyexample-->

TYPTR-->remove context/                                             /

kunnr-->removecontext-->sort-->splibyvalue(valuechange)-/

--->splibyvalue(eachvalue)-->type

-----------------------------------------------------------------------------------------

Regards

Venkat

Former Member
0 Kudos

Hello Venkat,

Sorry but it doesn't work, I have only one record without any data.

It seems that I have to use "item" but where in the mapping ?

Thanks a lot for your help.

JC

anand_shankar10
Active Participant
0 Kudos

Set the context of each field to "item" and than proceed. This will help to paas a blank value in the context while mapping.

Regards

Anand

Former Member
0 Kudos

I have just add :

item --> collapseContext --> deliveryCalendar

And now it works.

Thanks everyone, and especialy to Venkat.

JC

Former Member
0 Kudos

Hi Jean,

Congrats.Below mapping is sufficient.

Basic funda:Top node should open in order to populate bottom values.I thought you will take care of it.

item --> deliveryCalendar .

Regards

Venkat

Answers (1)

Answers (1)

Former Member
0 Kudos

JC,

simple one... try to play with node functions, will be easy for you.

Btw, Here you go:

KUNNR context set to "IT_DELDATE".

Target element :

client:

clinr:

strdate:

date:

type:

Hope this helps

--Divyesh Vasani