where condition in message mapping
I'm facing the problem with message mapping on PI. I have a source message in which is a table included.
For every line in that table I need to create a line in the target structure table but only when one of the fields in that source table is populated.
The source structure looks like this:
The target structure looks like this:
For every item of the souce message I need to create a targed item where FieldName is a constant and FieldValue is a UnitPrice value from source message. But I don't want to create target item for empty UnitPrice values.
I tried to use node finction Remove context, so my mapping looked like this:
UnitPrice --> RemoveContext --> item
Constant --> FieldName
UnitPrice --> FieldValue
This is working for source strucuture where all UnitPrice fields are populated. But if there are 5 source items and only 3 last UnitPrice fileds of them are polulated, then the target structure have 3 items created, but first 2 FieldValue fileds are blank and the last one has the value of the third source UnitPrice field. So the mapping gets first 3 values of source UnitPrice field and not the last 3 as needed.
Please, is there a solution in graphical MM or do I have to use XSLT or Java/ABAP mapping?
Thanks for any help!
you could do it like this:
UnitPrice -> removeContext -> exists -> createIf -> item
UnitPrice -> removeContext -> splitByValue -> FieldValue