cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping for multiple item levels

Former Member
0 Kudos

Hi,

My query is regarding message mapping

Example of source data structure & Target data structure

Source data Structure

<item>

      --<no>1</no>

      --<address/>

      --<ITEMS>

        ----<item>

          ------<Name>a</Name>

        ----<item>

          ------<Name>b</Name>

<item>

      --<no>2</no>

      --<address/>

      --<ITEMS>

        ----<item>

          ------<Name>c</Name>

        ----<item>

          ------<Name>d</Name>


Expected  Target data structure

<Item>

  -- <no>1</no>

  -- <name>a</name>

<Item>

  -- <no>1</no>

  -- <name>b</name>

<Item>

  -- <no>2</no>

  -- <name>c</name>

<Item>

  -- <no>2</no>

  -- <name>d</name>

How I can map the '<no>' field to target '<no>' field to repeat value until to second sub item level occurance complete ?

Thank you

Sateesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sateesh,

Please see the solution below.

The are 2 contect changes you need to do on field level. Right click and go to context and select your context you need.

Context on ITEMS - Should be on Root Structure(In my mapping it is MT_Multiple_Item_Level_Source)

Context on Name - Should be on Item (The first Item Tag)

Good Luck.

Regards,

Jannus Botha

vicky20691
Active Contributor
0 Kudos

Hi Jannus,

Thanks for the response.

This method is not working if <ITEMS> will have 2 <item> under it.

Please suggest a solution for this case.

Thanks,

Vikas

Former Member
0 Kudos

Hi Vikas,

Yeah i didnt design it like that but it is a easy fix. But it doesnt make sense to have multiple under both structures.

So instead of mapping <ITEMS> to target <item>. You will map <item> to target <item> with the same context changes.

And also instead of mapping <ITEMS> to useAsMany you will now use <item> source. With the same context.

Please see my results in the screenshot.

Regards,

Jannus Botha

vicky20691
Active Contributor
0 Kudos

Thanks for the response Jannus,

I can't give a correct Answer award on that. Requesting Mr. Sateesh to do that please.

Regards,

Vikas.

Former Member
0 Kudos

Hi Vikas,

That is no problem. Was a good question.

Good luck,

Jannus Botha

Former Member
0 Kudos

I can't able to one more time Correct answer award instead of I gave you Helpful answer.

Thank you.

Sateesh

Former Member
0 Kudos

Thank you.

Answers (2)

Answers (2)

gagandeep_batra
Active Contributor
0 Kudos

Hi Sateesh,

You can use "useoneasmany" function for that

check below for more:

useOneAsMany (SAP Library - Partner Connectivity Kit)

Regards

GB

Former Member
0 Kudos

Hi,

Use the below link to achieve your requirement .

Regards

Venkat