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: 

Conversion of base 10 to base 36

Former Member
0 Kudos

Hi All,

I have requirement to convert numbers from Base 10 to base 36. I know sap have data type of base 16 that is hexadecimal. Please let me know any FM or method by which i can convert integer from base 10 to base 36.

Thanks,

Sarbpreet Multani

2 REPLIES 2

Former Member
0 Kudos

Hi

I haven't found any... recently I had the same issue. I used something similar to that:


  WHILE v_value GT 0.
    v_mod = v_value MOD v_base.
    v_value = v_value DIV v_base.
* V_charset = '01234567890ABC...Z'.    
    concatenate v_charset+v_mod(1) po_value INTO po_value.
  ENDWHILE.

v_base is 36

v_value is your input

po_output is the result in base 36

v_charset is a constant '0123456789ABC... with 36 characters

maybe you should put some validations there...

If someone knows a standard FM it will be great.

Hope it helps.

Best regards

andrey_ryzhkov
Participant

Hi! You can use FM TB_LIMIT_CONVERT_DEC_TO_36.