Skip to Content

SAP PI Beginner - Create Multiple Nodes Conditionally

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 12, 2016 at 04:08 PM

    Hello Adam,

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.