Skip to Content
avatar image
Former Member

UDF to validate Numeric value

Hi PI Experts,

I am trying to validate a field whether it is a Numeric or not.

I have used below UDF's and have checked few blogs too.

UDF-1

********

try{ Integer.parseInt(num); } catch(NumberFormatException nfe) { return "false"; } return "true";

UDF - 2

*****

int x = 0;

try{ Integer.parseInt(a);

return "true";

}

catch(NumberFormatException e)

{

return "false";

}

https://archive.sap.com/discussions/thread/533354

Above UDFs working fine up to 10 digits, and it is not validating for more than 10 digits.

I am getting out put as "false" for numeric value contains more than 10 digits.

Please help me out by providing appropriate UDF to validate more than 10 digits.

Thank you,

Chakradhar N

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 04, 2017 at 07:51 AM

    Hi,

    You can use this code.

    UDF is simple type

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 04, 2017 at 08:04 AM

    Hi Mark,

    Thanks a lot for providing an UDF. It is working and issue got resolved.

    Thank you,

    Chakradhar N

    Add comment
    10|10000 characters needed characters exceeded