HI Everyone,
I am having a bit of a blank on this one and would appreciate any pointers.
In my mapping I need to create a target node only when an Segment with a Particular Value exists in an IDoc- otherwise if that segment exists in the IDoc but without the particular value it should create the target node but with a default value.
There can be multiple IDocs in the Payload and the target Record is creating for every Line item in the IDocs. (So 3 IDocs with 5 line items = 15 records in target)
So
if
E1ADRM1-PARTNER_Q = 'XX'
then
Partner_ID = '123' -> Pass to RFC Lookup to get Ref Code (ABC) -> useOneAsMany (for each line item) -> Target Node
I'm using an if-then statement so only when E1ADRM1-PARTNER_Q = 'XX' will the target node create.
This is fine and this works so long as each IDoc has E1ADRM1-PARTNER_Q = 'XX' - but sometimes an IDoc will have the E1ADRM1 segments but not with PARTNR_Q = 'XX' - When this happens the mapping is failing - So in this case the target node should be created with a default value 'AAA'.
I've tried changing PARTNER_Q context to IDoc to check at IDoc Level whether it contains E1ADRM1-PARTNER_Q = 'XX' or not but keep running into context errors.
I've tried duplicating subtree for the Target Node and splitting the mapping but that doesn't work either.
In basic terms I need to check whether the IDoc has E1ADRM1-PARTNER_Q = 'XX' and if it's there do the mapping or otherwise just create the target but with a default value 'AAA'- i dont care about the other E1ADRM1 segments but I can't elimate these from the value queue which causes context issues.
I'd appreciate any tips.
Thanks
JE