Skip to Content
0

UDF to validate Numeric value

May 04, 2017 at 07:39 AM

79

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mark Dihiansan May 04, 2017 at 07:51 AM
1

Hi,

You can use this code.

UDF is simple type

Regards,

Mark


untitled.png (14.4 kB)
untitled.png (17.9 kB)
Share
10 |10000 characters needed characters left characters exceeded
Chakradhar Nunna May 04, 2017 at 08:04 AM
1

Hi Mark,

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

Thank you,

Chakradhar N

Share
10 |10000 characters needed characters left characters exceeded