Skip to Content
avatar image
Former Member

Validating fields in message mapping

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 18, 2007 at 07:33 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • avatar image
    Former Member
    Dec 18, 2007 at 10:46 AM

    Hi

    did my reply helped you.

    Kindly indicate.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 18, 2007 at 08:03 AM

    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.

      Add comment
      10|10000 characters needed characters exceeded