cancel
Showing results for 
Search instead for 
Did you mean: 

BASE64 decoding of numbers ?

Former Member
0 Kudos

Hi,

when I decode and uncode a string using following method :


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

CALL METHOD cl_http_utility=>IF_HTTP_UTILITY~DECODE_BASE64 EXPORTING
encoded = foostr
receiving
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 ?

Dirk.

Accepted Solutions (1)

Accepted Solutions (1)

eddy_declercq
Active Contributor
0 Kudos

Dirk,

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.

Eddy

Former Member
0 Kudos

Hello Eddy,

It works well indeed, the problem was that after the encoding I moved the string to a field with type kunnr.

Then I moved to another page, retrieved the field kunnr and moved it into a string for decoding.

That's the story of my life : Poor, Stupid and Ugly.

Thanks.

Dirk.

eddy_declercq
Active Contributor
0 Kudos

OK, Glad it's solved. I guess it's the story of my life too. At least you get some nice potplats in the neighbourhood

Is the sun already shining in Lochristi? In Leuven, it's still cloudy.

Eddy

Former Member
0 Kudos

No sun yet, they are saving it for the weekend.

About the potplants you are right, but then again in Leuven

the pub-infrastructure is more populated;-)

Dirk.

Answers (0)