cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello.

Currently I'm facing a weird structure to map, source is a well defined xml data object but target structure is weirdly de-coupled and I'm not sure how to solve it via message mapping. I was asked to avoid java mapping usage, so I have to try to make it work with message mapping.

Source structure is something like this:

As you can see is a normal well defined xml data object with two header fields acting like a primary key.

Target structure would be:

It is like it was defined as relational tables where struct acts as a header table and substruct is another table referencing struct by the composite primary key. Items are like registries in the tables. I know is weird but it is the requirement.

I have tried several combinations of functions remove context, use one as many and split by value but none of them seems to get the desired result.

Thanks in advance for any help the community can offer.

0 Likes
View Entire Topic
JaySchwendemann
Active Contributor

If XSL is not an option, this should be doable with usaOneAsMany and some context magic. Admitedly UOAM is one of the most user-unfriendly functions there is, and every time I need it I refrain from doing so, as I need to get my head around it once more.

That being said, have a look at https://integrationlearn.com/sap-pi-mapping/useoneasmany-explained-in-easy-example/ (this was once a blog within SDN but I can't for the live of me find it within SAP community. I hope it was mutually agreed to move outside and it was not simply nicked 😉

This should quite well match your requirement? The biggest difference I see is that you are having sub-structures while the tutorial doesn't.

Also look at this: https://blogs.sap.com/2015/02/20/useoneasmany-in-sap-pi/

Cheers

Jens

Former Member
0 Likes

Great links!

I'll bookmark them.

Thank you very much Jens.