Mapping : Purge </null> field after mapping service


I have a service called by SAP Handler in order to map an IDOC into my publishableCanonical.

Because we have an Idoc, we have a lot of Loop with Input and output array.

When we enter into a loop in order to map with a condition, we see that the loop create an array even if the condition under this loop doesn’t map something.

The result is that we have a lot of document in a documentList into the publishableCanonical that are “null” and the icon use in the developper is like an object item.

It’s very unplaisant because next services rise errors because of elements.

How can I do to :

  • Clean every “Null” elements in my publishableCanonical at the end of the mapping service


  • In the loop that have output array, say “Please erase the document in the targetted document list”

Thanks people



Instead of specifying an out list in the loop, you can use appendTo*List services within the loop to add to the out list only when desired.

Be aware that this approach suffers performance issues when the list gets to be a few hundred items in size.

Thanks ! It’s working !