Skip to Content
0
Nov 01, 2019 at 09:18 AM

Conversion From Hex To Decimal

482 Views

Dear Experts,

I have a code from #C from hex data type as follow

0x01 that will read in serial port as 01

How do you convert that into abap code?

DATA: x type i.

x = cl_abap_codepage=>convert_to( '0x02' )

The expected result should be 2

but I get 813183026

Thanks,

Sam