cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping: convert multiple tables w/ common key to single one w/ that key?

Former Member
0 Kudos

Hi,

I need to map this message containing customer information in multiple lists, to a single customer list based on the customer key.

Example:

SOURCE:

Root

...ACCOUNTS... 1

........ITEM... 0-unbound

............CUSTID... 1

............NAME ... 0-1

...PHONES ... 1

........ITEM ... 0-unbound

............CUSTID ... 1

............AREACODE ... 0-1

............NUMBER ... 0-1

...EMAILADDRS...

........ITEM ... 0-unbound

............CUSTID ... 1

............EMAIL ... 0-1

TARGET:

Root

...CUSTOMERS ...1

.......ITEM...0-unbound

...........CUSTID ... 1

...........NAME ... 1

...........PHONES...1

................PHONEITEM...0-unbound

....................AREACODE...0-1

....................NUMBER...0-1

...........EMAILS...1

................EMAILITEM...0-unbound

....................EMAILADDR...0-1

Has anyone done this and can tell me how or at least point me in the right direction? I've been checking the forums but have not seen such an example with multiple tables. I saw a simpler one that uses function SplitByValue, but I'm not sure it can be applied here.

Thanks in advance.

Carlos

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

You have to use Remove Contexts for this type of mapping.

Answers (5)

Answers (5)

Former Member
0 Kudos

The solution pointed out by Gaurav in this SAP example:

http://help.sap.com/saphelp_nw04/helpdata/en/59/f6ae42e0fac911e10000000a1550b0/content.htm

was quite close, except that:

1. My target structure has an additional context which also needs to be created by the mapping.

2. For some reason, SAP doesn't mention in the above example that you need to explicitly change (or remove) the context for the PersonId and Number elements in this mapping, otherwise it doesn't work.

Anyway, I only discovered point no. 2 above after I had already implemented my own solution, which I have documented here:

http://chplanet.ca/documents/SAP/XI%20Mapping%20Flat%20to%20Nested%20Tables.pdf

Thanks again to all who responded.

Carlos

Former Member
0 Kudos

Thanks, everyone. I guess I now have plenty of ideas to explore. I will leave the question unanswered for now since this mapping will take some time to produce, but I will update it later.

I have awarded points to all that responded so far.

Thanks.

Carlos

Former Member
0 Kudos

Hello ,

You will get solution from this Blog.....

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

***********Reward points,if found useful

Former Member
0 Kudos

Hi,

1) U can map ,

(CUSTOMERS ...1

.......ITEM...0-unbound)

ITEM with from target stucture to

(ACCOUNTS... 1

........ITEM... 0-unbound

............CUSTID... 1)

CUSTID

CUSTID --> RemoveContext --> Sort --> SplitByValue(valueChange) --> collapseContext --> ITEM.

2) Map PHONEITEM with (PHONES) ITEM 1 to 1

3) Map EMAILITEM with (EMAILADDRS) ITEM 1 to 1

4) Map CUSTOMERS with ACCOUNTS 1 to 1

5) Map PHONES with PHONES 1 to 1

6) Map EMAILS with EMAILADDRS 1 to 1.

I think this will help you.

Regards,

Rohit.

Reward points if useful.

Former Member
0 Kudos

HI Carlos

This can work for you

http://help.sap.com/saphelp_nw04/helpdata/en/d0/d4b54020c6792ae10000000a155106/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/d0/d4b54020c6792ae10000000a155106/frameset.htm

Use collapseContexts, SplitByValue, removeContexts and value for SplitByValue as Each Value

Thanks

Gaurav Bhargava

Former Member
0 Kudos

Hi Gaurav.

Thanks for your reply.

However the links you provided point to an unrelated topic in the XI help book. Were you just trying to point me to the corresponding functions help? Or is there another specific page I should look at? Thanks.

Carlos