Skip to Content
0
Former Member
May 05, 2017 at 09:59 AM

remove null in the SAP PI mapping context queue

3042 Views

Hello Experts,

How to check null value and xsi:nil in the queue when we have multiple instances in the context.

there are two possibilities in input which I need to handle as below

1. node does not exist the source message then the value would be "<null>" in the display queue

2. node exist but with attribute nil = true then the value would be "xsi:nil" in the display queue

I need True of False when I get the above input and I would like to handle both the scenarios in single UDF.

I created a UDF as per mentioned in the below link

https://blogs.sap.com/2013/02/05/null-in-the-sap-pi-mapping-context-queue/

for(int i=0;i<var1.length;i++){

if(var1[i] == null){ result.addValue(“true”);}

else{ result.addValue(“false”);}}

but this UDF is not working in when input is <null> scenario.

and I tried as below

if (var1.length == 0) result.addValue("false");

else result.addValue("true");

return;}

this is working when I have only one instance in the context.

Please share your comments on this.

Attachments

capture.jpg (16.1 kB)