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,801

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 Chuo,

Try the below code to remove SUPRESS:

1. Enable KeepSUPRESS for the IfwithoutElse

2. Delete both of your UDFs and replace it with the above code and it should work.

jamaic
Explorer
0 Kudos

Hi Sneha,

Thanks for weighing in. I deleted both of my UDFs, enabled the KeepSUPPRESS and replaced it with your code, but the <null> values are still there. Below is the results that i got.

Regards,

Chuo