Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Calculations (addition) Hexadecimal Number

0 Kudos

Hello all,

I have string with hexadecimal numbers e.g. 50474E33344C31 then I convert every character to byte

5 = 35, 0 = 30, 4 = 34, 7 = 37, 4 = 34, E = 45, 3 = 33, 3 = 33, 3 = 33, 4 = 34, 4 = 34, C = 43, 3 = 33, 1 = 31

and then I need add every to each: 35 + 30 = 65 + 34 = 99 + 37 = D0 + 34 = 04 + 45 = 49 + ...

I don't know how to calculate it in abap e.g. 99 + 37 = D0, D0 + 34 = 04 ?

2 REPLIES 2

Abinathsiva
Active Contributor
0 Kudos

Hi

Following help link document will help to handle. https://help.sap.com/doc/saphelp_nw70/7.0.31/en-US/b6/e7d716f46711d195200000e8353423/content.htm?no_cache=true#:~:text=In%20a%20hexadecimal%20field%20(type,00'%20to%20'FF'.

Sandra_Rossi
Active Contributor

I don't understand what you're trying to achieve, but if it's about hexadecimal to decimal conversion, in the ABAP documentation, you can find explanations about Type Conversions: when a one byte field is moved into an integer field, it does the hexadecimal to decimal conversion, e.g. hexadecimal 50 is converted into decimal 80.

If it's about decimal to hexadecimal conversion, just do the opposite.

Please explain what you tried if you need further assistance.