Skip to Content
avatar image
Former Member

UDF to check the amount value

Hi

I have a scenario where i have to check the amount value sholuld be greater than Zero or not, if it is not greater than zero i have to raise an exception and skip that record ..

i wanna do that using UDF..How we do that

venkat

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 08, 2007 at 01:36 PM

    oops,

    int AmountValue =Integer.parseInt( Amount);

    try{

    if(AmountValue>0)

    {

    create record;

    }

    else throw new Throwable("Records not greater than 0...");

    }catch(Throwable t){}

    In the if condition, use the variable AmountValue.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 07, 2007 at 08:22 PM

    venkat,

    R u referring to Universal disk format....

    Regards

    Ravi Raman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 07, 2007 at 09:19 PM

    Create a UDF with through this psudocode

    int i = Integer.parseInt(a);

    try{

    if(amount>0)

    {

    create record;

    }

    else throw new Throwable("Records not greater than 0...");

    }catch(Throwable t){}

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi paul

      I need to Import Any Java packages .

      It s giving Error :

      Source code has syntax error: /usr/sap/D06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map08e7dc10452d11dcb4a1e210bc394725/source/com/sap/xi/tf/_MM_ACEAwardInformation_to_TaxBalances_.java:113: operator > cannot be applied to java.lang.String,int if(Amount>0)

      My code

      public String AmountValue(String Amount,Container container){

      int AmountValue =Integer.parseInt( Amount);

      try{

      if(Amount>0)

      {

      create record;

      }

      else throw new Throwable("Records not greater than 0...");

      }catch(Throwable t){}

      venkat

  • avatar image
    Former Member
    Aug 07, 2007 at 09:24 PM

    You might want to look at this thread for specific Exceptions that you can use in XI.

    raise an exception

    Add comment
    10|10000 characters needed characters exceeded