05-04-2021 8:30 AM
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 ?
05-04-2021 8:39 AM
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'.
05-04-2021 10:26 AM
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.