cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI Beginner - Create Multiple Nodes Conditionally

0 Kudos

Hello,


I am very new to SAP PI, and I have been searching for a clear answer to this but haven't found my solution.

In my source file, I have a field called <MakeBuy>.  Depending on the value of this field, I need 1,2 or 3 instances of a destination node with different values within.  I need assistance with how to set this up in the Message Mapping.

Example:

If in source, <MakeBuy> = "Make" then in my destination I need Two <ItemValue> nodes:

<ItemValue>

     <UnitValue>

           <Amount currencyID="USD">0.00</Amount>

           <PerQuantity>1.00</PerQuantity>

           <Code>AverageMaterialCostPerUnit</Code>

     </UnitValue>

</ItemValue>

<ItemValue>

     <UnitValue>

          <Amount currencyID="USD">0.00</Amount>

          <PerQuantity>1.00</PerQuantity>

  <Code>AverageLaborCostPerUnit</Code>

  </UnitValue>

</ItemValue>

If in source, <MakeBuy> = "Buy" then in my destination I need One <ItemValue> (with different constant):

<ItemValue>

     <UnitValue>

           <Amount currencyID="USD">0.00</Amount>

           <PerQuantity>1.00</PerQuantity>

           <Code>AveragePuchasePriceForUnit</Code>

     </UnitValue>

</ItemValue>

Then finally if <MakeBuy> = "MakeBuy", then I would need all 3 of the <ItemValue> nodes listed above.  Could someone point me in the right direction?

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor

Hello Adam,

Duplicate the target node and use createIF with the required conditions.

JaySchwendemann
Active Contributor
0 Kudos

Sometime good things come in small packages... neatly solved. Thanks

Answers (0)