Skip to Content
author's profile photo Former Member
Former Member

BASE64 decoding of numbers ?


when I decode and uncode a string using following method :

CALL METHOD l_http_utility=>if_http_utility~encode_base64
unencoded = foostr
encoded = foostr.

encoded = foostr
decoded = foostr.

everything works fine.

If I put a number in foostr ( 0000002525 )however, the decode-method does not contains the correct number.

Am i doing something wrong, works this method only with chars ?

I have searched the community on BASE64, found some blogs but nothing that covers my question.

Any hints ?


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 17, 2005 at 07:54 AM


    It only works with strings. You can check this in the class interface of CL_HTTP_UTILITY. In the IF_HTTP_UTILITY~DECODE_BASE64 method, you can see that the params are both strings. Same thing for the ENCODE method.

    I tried out your example.

    data: test type string.

    test = '0000002525'.

    test = cl_http_utility=>ENCODE_BASE64( unencoded = test ).

    test = cl_http_utility=>DECODE_BASE64( encoded = test ).

    It worked well.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.