cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove null from queue context using UDF in SAP PI mapping

jamaic
Explorer
0 Kudos
2,808

Hi There,

I trying to map an ORDERS IDoc to EDI ANSI X12 850 and my message mapping is creating SUPPRESS and <null> values in the context. Specifically, i'm trying to map the IDoc segment E1EDPT1/E1EDPT2/TDLINE to L_PID (X12 850). The <null> values is causing the output L_PID not to be created as desired. I would have used RemoveContext and SplitByValue after the IfwithoutElse, but i don't want to destroy the context. In an attempt to remove the <null> values, i wrote a UDF but it didn't help. Attached are the screenshot of the problem.

This is the mapping:

image.png

These are the SUPPRESS values from the output of the IfwithoutElse

Here i'm trying to delete the SUPPRESS values and it produces the <null> values.

Here i'm trying to remove the <null> values with a UDF, but it still doesn't work.

Here's my UDF. Trust me i've google the internet for sample UDFs.

Regards,

View Entire Topic
0 Kudos

Hi ,

The UDF works only in your test case. if the XYZ values are populated two or more than two, then if fails to remove the values.

Thanks,

Pradeep.