Skip to Content

Sorting records in split message mapping

Hi

Hi,

I want to create a message mapping according to this picture:

picture-1.png

At the bottom of our source we have ‘begindatumtijd’ and ‘einddatumtijd’.

If all ‘verbruik’ are in the same period (i.e. same ‘begindatumtijd’ and ‘einddatumtijd’) we create 1 idoc and all is well.

However, if we have two periods we must create two idocs.

All ‘telwerk’ are not sorted to period, so we can have a ‘telwerk’of period 1, then 2 ‘telwerk’ of period 2, then 3 ‘telwerk of period 1, then 1 telwerk of period 2 etc etc.

The first idoc must have all ‘telwerk’ segments where ‘verbruik’ is in period 1

The second idoc must have all ‘telwerk’ segment where ‘verbruik’ is in period 2.

I’m mapping ‘telwerk’ to ‘ZCMFTEL’.

In the mapping so far I can create the 2 idocs, and also mapping all the values etc, but I don’t succeed in sorting the ‘telwerk’ according to period. (so according to ‘begindatumtijd’)

I tried various options with sorting, sorting by key, format by example, playing around with context changes etc etc, but so far I can’t get it to work.

One example:

picture-2.png

Is it possible at all with graphical mapping? Do I need UDF?

One issue i think that is bothering here is that i'm basically trying to sort a queue of contexts (and not a queue of values), but maybe i'm wrong here.

Any help greatly appreciated.

Regards

Robert

picture-1.png (60.3 kB)
picture-2.png (16.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Ok, it took me quite a while but i found the way to do it. It involves 3 mapping steps in one operation mapping.

    1) i simplify the source structure by taking out some of the depth

    2) i found an XSLT to help me sort the records

    3) i create the final message with 2 or more idocs

    I tested the operation mapping in the ESR and it works. Good!

    Now im waiting for final testresults from a true end to end test. I will post more details after that.

    But for now the question is as good as answered.

    Regards

    Robert

  • Get RSS Feed

3 Answers

  • Feb 13 at 08:22 PM

    Hi Robert,

    Can you please give us an example for understanding.

    Regards,

    Anoop

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 14 at 08:01 AM

    Hi Anoop,

    I will provide it. But due to availability it may take a few days.

    Regards

    Robert

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 18 at 12:19 PM

    Hi,

    So here are more details. The source message looks like this source-messsage-picture.png

    And you will find the complete source in here: sorce-message-xml.txt

    So in the source message you will find P1B which stands for Period 1 Begin, P1E = Period 1 end, etc etc.

    This is target message, currently with 2 idocs: target-idoc-message.png

    As can be seen the 1rst idoc has 1 "telwerk" records with P1 and 1 "telwerk" record with P2.

    My requirements is that in target message all "telwerk" records with P1 go in the first idoc, and all "telwerk" records withe P2 go in the second idoc. (and if needed we have a 3rd period than all "telwerk" with P3 go in a 3rd idoc)

    I know how to create the idocs as needed, and i can get the amount of telwerk records in each idoc, but they are not the correct ones.

    As stated above i tried a various options with all sort of combinations of node options etc, but so far failed to accomplish.

    Any help greatly appreciated.

    Regards

    Robert

    Add comment
    10|10000 characters needed characters exceeded