cancel
Showing results for 
Search instead for 
Did you mean: 

UseOneAsMany Function Not Working

former_member331856
Participant
0 Kudos

Hi Experts,

I have tried the example from the below blog: SAPTechnical.COM - Implementation of Node functions

I have changed the context level as mentioned in the blog. I have changed the Plant Context Level to Mt_Sender for both MatNo and MatDesc while Mapping on target Side. Remaining i have Mapped normal field to field from Source to Target. When i am checking the Message Mapping it is throwing the Error as mentioned below:

Source Structure:

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

<ns0:MT_Sender xmlns:ns0="http://UseOneAsManyExample">

   <Header>

      <MatNo>MatNo</MatNo>

      <MatDesc>MatDesc</MatDesc>

   </Header>

   <Item>

      <MatNo>MatNo1</MatNo>

      <ItemNo>ItemNo1</ItemNo>

      <MatGroup>MatGroup1</MatGroup>

      <Mattype>Mattype1</Mattype>

      <Plant>Plant1</Plant>

   </Item>

   <Item>

      <MatNo>MatNo2</MatNo>

      <ItemNo>ItemNo2</ItemNo>

      <MatGroup>MatGroup2</MatGroup>

      <Mattype>Mattype2</Mattype>

      <Plant>Plant2</Plant>

   </Item>

</ns0:MT_Sender>

Required Target Structure should be as mentioned in the blog. This is a very basic example, but i am not getting the Output. Please check and let me know where i am going wrong in mapping.

Regards,

GIRIDHAR

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Giridhar,

Please confirm the error you are facing and also if possible please provide a screen shot of your mapping.

Regards,

Sriram

former_member331856
Participant
0 Kudos

Hi Sriram,

Please check the Error in the attachment.

Regards,

GIRIDHAR

Former Member
0 Kudos

Hi Girridhar,

Please can you provide a screenshot of how you used the UsedOneAsMany function?

But just be a queue issue. Have used that function a lot.

Regards

Jannus Botha

former_member190624
Active Contributor
0 Kudos

Hi Giridhar,

Please provide mapping screen shot (not test screen shot ) . Can you try below logic for UseOneAsMany function .

1st parameter MatNo (from source Header Node)

2nd & 3rd parameter Item (from source structure).

Thanks

Hari.

former_member331856
Participant
0 Kudos

Hi Botha,

Please check the Screenshots in the attachment.

Regards,

GIRIDHAR

former_member190624
Active Contributor
0 Kudos

Hi Giridhar,

Please use Split by value node function after UseOneAsMany function . Issue will be solved.

Thanks

Hari.

former_member331856
Participant
0 Kudos

Hi Hari,

I have Mapped as you mentioend above. Please find the screenshots in the attachment. Remaining all the fields i have mapped to the corresponding fileds from Source to target Structure.

Regards,

GIRIDHAR

former_member190624
Active Contributor
0 Kudos

Hi Giridhar,

You have add context between each output , Please use SplitByValue node function after UseOneAsMany function . Issue will be solved.

Thanks

Hari.

former_member331856
Participant
0 Kudos

Hi Hari,

I have used SplitByValue after each UseOneAsMany Function in the Message Mapping. Now i am getting the error as attached in the screenshot.

Regards,

GIRIDHAR

former_member190624
Active Contributor
0 Kudos

Hi Giridhar,

Error describes about occurrence of <Item> (on target side). Did you mapped <Item> (on source side) to <Item> (On Target side) ?

And make sure Header and Item (on target side ) occurrence are same.

Thanks

Hari.

Message was edited by: HariKumar Vemuri

former_member331856
Participant
0 Kudos

Hi Hari,

I have changed the Occurrence of Header on target to o to unbounded and now the occurrence of item and Header are same in the target. But i am getting the Target Result as mentioned below: Header1 with two items item1, item2 followed and then Header2. But Output should be Header1 followed by item1 and then Header2 with item2. Please check the error which i am getting now and please suggest me how can i proceed further.

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

<ns0:MT_Receiver xmlns:ns0="http://UseOneAsManyExample"><Header><MatNo>MatNo</MatNo><MatDesc>MatDesc</MatDesc><MatGroup>MatGroup1</MatGroup><Item><MatNo>MatNo1</MatNo><ItemNo>ItemNo1</ItemNo><MatType>Mattype1</MatType><Plant>Plant1</Plant></Item><Item><MatNo>MatNo2</MatNo><ItemNo>ItemNo2</ItemNo><MatType>Mattype2</MatType><Plant>Plant2</Plant></Item></Header><Header><MatNo>MatNo</MatNo><MatDesc>MatDesc</MatDesc><MatGroup>MatGroup2</MatGroup></Header></ns0:MT_Receiver>

Regards,

GiRIDHAR

ambrish_mishra
Active Contributor
0 Kudos

Best way is to provide source structure and target structure and field level requirement. Field at the header level should be the first parameter and the second and third knows defines when it repeats (context) and how many times. The target node should be created as many times.

At field level, split by Value should be used.

Hope it helps!

Ambrish

Former Member
0 Kudos

Hi Giri,

Use the below logics.

Item-->header

MatNo---->useoneasmany-->splitbyvalue(eachvalue)-->MatNo

Item--/

Plant--/

//ly do for MatDesc

Item-->splitbyvalue(eachvalue)-->Item

MatGroup-->MatGroup

MatNo-->MatNo

//ly do for rest of the fields

Regards

Venkat

former_member190624
Active Contributor
0 Kudos

Hi Giridhar,

Retain your current mapping logic and change the occurrence of Item (on Target side ) to 1 ,as shown below .

and do one to one mapping to sub fields of Item node.

Output :

I believe , blog you are referring to might have wrong target structure.

Thanks

Hari.

former_member331856
Participant
0 Kudos

Hi Hari,

Thanks for the Reply. Thanks for the Screenshots also. Issue is resolved.

Regards,

GIRIDHAR

Answers (0)