cancel
Showing results for 
Search instead for 
Did you mean: 

message mapping challenge for a newbie

Former Member
0 Kudos

Dear PI message mapping experts,

I'm a newbie in PI and facing a mapping problem using graphical message mapping.

I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.

Here after is the mapping i need to perform :

Source structure IDOC :


<E1EDKA1> (0..99)
   <NAME1> A </NAME1>  (0..1)
   <NAME2> B </NAME2>  (0..1)
   <NAME3> C </NAME3>  (0..1)
   <NAME4> D </NAME4>  (0..1)
</E1EDKA1>

Target structure :


<AccountingCustomerParty>  (1..1)
   <Party> (0..1)
      <PartyName> (0..unbounded)
          <Name>A</Name> (1..1)
      </PartyName>
      <PartyName>
          <Name>B</Name>
      </PartyName>
      <PartyName>
          <Name>C</Name>
      </PartyName>
      <PartyName>
          <Name>D</Name>
      </PartyName> 
   </Party>
</AccountingCustomerParty>

I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.

Could you please help me ?

Thanks in advance,

Alysee

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

right-click --> duplicate subtree PartyName thrice...so now you have 4 nodes...then

Name1/2/3/4 --> PartyName .....individually map it to the PartyName

Similarly map Name1 to Name of PartyName1...

Former Member
0 Kudos

Hi,

Please try as below:

1. Create a source structure

<AccountingCustomerParty> (1..1)

<Party> (0..1)

<PartyName> (0..unbounded)

<Name>A</Name> (1..1)

</PartyName>

</Party>

</AccountingCustomerParty>

2. When in message mapping, duplicate the node 'PartyName' 4 times. Right click on the 'PartyName' Node and you would find Duplicate Subtree.

3. Map 'Name1' field in the source to the first 'PartyName' node in the target. Similarly, map Name2, Name3 and Name4 fields to their respective 'PartyName' nodes.

4. Map the 'Name1' field in the source structure to first 'Name' field in the first 'PartyName' Node. Similarly, follow the same process for Name2, Name3 and Name4 fields. By doing so, your requirement would be met.

Thank you.

Regards,

Subbu