Skip to Content

SAP PI 7.31 - Node function Exists bug?

Hi to all,

I am facing a strange behavior of the node function Exists in the mapping.
I am trying to check if a field is present in the input paylod (an idoc) and if not present I set a default value. I followed too the SAP note 1319395 (SAP Note 1319395) changing the context to the highest level but nothing changed and the result was an empty result.

I show you some examples:

This is with normal context.

This is with context Idoc node.

Can you help me to understand? there is a BUG? My version of SAP PI is 7.31 SP 04.

cattura.jpg (125.3 kB)
cattura2.jpg (121.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 26, 2017 at 09:57 AM

    Hello Anonio.

    This is because you missed the root nodes mapping of the target structure.

    See the below cases

    Case 1(If I didn't map the root nodes of the target):

    Case 2(If I map the root nodes of the target):

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 26, 2017 at 10:23 AM

    Hi Antonio!

    There is no need to use "Exists" function for your requirement. It's enough to use "MapWithDefault" instead.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded