cancel
Showing results for 
Search instead for 
Did you mean: 

Can XI check input data if it has a blank value

Former Member
0 Kudos

HI all,

In my scenario, the input data for SAP XI consists of many fields which some fields have value and some fields don't which depends on many things. For my output, I need to use only some of them. Therefore, I'll use XI to do some mapping. My question is I want to to check that after mapping if no field has a value ( All fieds have blank value ), I don't want XI to send data to the output because it will be just a rubbish. Can XI do this? Any solution and example would be appreciated and rewarded.

Best regards,

Pavin P.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Do you have any sample code for this?

Former Member
0 Kudos

If you have 4 variables(a,b,c,d) for which you have to check whether they exists or not.

UDF: checkNull

if(a.equals(null)&&b.equals(null)&&c.equals(null)&&d.equals(null))

return null;

Now using graphical mapping add IfWithoutElse and provide output of this UDF to not and not to if condition.

Make sure that the context is defined at the root level for all the source nodes.

regards,

Anirudh.

VijayKonam
Active Contributor
0 Kudos

Write a UDF for checking all the values you are intested in checking for null and map it to the root node of the target message. If they are null no target will be generated and no message will be sent to target system.

VJ