cancel
Showing results for 
Search instead for 
Did you mean: 

Validating a string as a HEX number?

Former Member
0 Kudos

Hi,  I have MII 14.0.5.11, I need to validate if a string is a HEX number. I used number function with "0X" as prefix but not working. Can anyone help on this?

Message was edited by: Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What you are doing is correct. Are you getting any error when you use the number function?

Regards,

Anushree

Former Member
0 Kudos

Hi,

I have couple of issues,

1. When I assign number("0XFFFF") to a local variable TEST and when display the TEST variable the value is 0.

2. When I pass a invalid HEX number to the number function it is success and not throwing any exception. ex number (0XFFFZ) and the value of TEST in this case in also 0.

Anything wrong?

Thanks

Shyam

0 Kudos

Try using a lower case "x" instead of the capital; I tried this and it worked as expected:

number("0xAB12")

I also tested this and received a "0" as the response:

number("0xAZ")

I agree that this should return a value of "NA" which is value of nullnumber or at the very least throw a number conversion exception.  Please write this up as a ticket.


Sam

PS: I tested this on my 15.0 SP02 P6 instance of MII

Former Member
0 Kudos

I tried with lower case "x" and it didn't work. I checked SAP Note 2033059 ant it says that this feature is implemented from 14.0 SP006 and I am using 14.0.5.11 but still not working.

Any clue?

Regards

Shyam

Former Member
0 Kudos

Hi,

Got it, I am having a lower version SP5 and this implementation is from SP6.

Thanks for the clarifications.

Regards

Shyam

Answers (0)