cancel
Showing results for 
Search instead for 
Did you mean: 

Validating fields in message mapping

Former Member
0 Kudos

Hi,

for a scenario , I need to validate each field of incoming file.if it is negative or left blank then that perticular record should be removed from the file. How can i achieve this. Please help.

Thanks&Regards,

Reyaz Hussain.G

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Write a simple UDF.

Take the input value in one context which is to be checked and map that value to root node.

input= a

for(i=0;i<a.length,i++)

{

if(a<i>.equals(""));

{result.addValue(SUPPRESS);}

else

{result.addValue("constant")} constant value is just required for generating the root node.

}

This is just a sample example now you can modify according to ur need.

Thnx

Chirag

Former Member
0 Kudos

My requirement is to skip entire record if perticular field of it has null value.I think the udf given by you is to supress that perticular field. how ever thanks for your reply.

Thanks&Regards

Reyaz

0 Kudos

Hey Reyaz,

Using UDF method of chirag you can drop whole line of source file if you write the udf for mapping your root node where you pass your key field and source node which you want to map to target as input and by checking your key field inside UDF you can decide whether the node and its subelements for the corresponding line should be created for the given deciding field or suppressed.

Regards,

Amit.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

did my reply helped you.

Kindly indicate.

Former Member
0 Kudos

Hi,

There are few scenarios you can take reference of.

Kindly have look at :-

/people/jacob.vandborg/blog/2005/11/29/schema-validation-of-incoming-message

Generic Approach for Validating Incoming Flat File in SAP XI - Part 1:-

/people/swaroopa.vishwanath/blog/2005/06/24/generic-approach-for-validating-incoming-flat-file-in-sap-xi--part-1

/people/swaroopa.vishwanath/blog/2005/06/29/generic-approach-for-validating-incoming-flat-file-in-sap-xi--part-ii

Vishal

    • Please reward points if helphhul.