Application Development and Automation 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: 
Read only

Base 64 encoding for internal table.

JayantkumarS
Participant
0 Likes
3,348

Dear Guru,

I need to convert ALV report output(internal table data ) to Base64 conversion. Is it possible using

encode = obj->if_http_utility~encode_base64( z ) .

As this take string for encoding.

Suggestion are much appreciated.

Regards,

Jayant.

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
2,257

Base 64 is just a way of passing bytes through a set of 64 characters. As this method takes a STRING parameter, those characters must be converted into bytes so that SAP is able to calculate the base 64 ; I guess the conversion into bytes is determined automatically by selecting the "charset" of the "Content-Type" HTTP header field (it's a problem if it's absent - maybe SAP will choose UTF-8).

To convert the ALV table into characters is another question; you may use the CSV format for instance (and then convert CSV into base 64).

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
2,258

Base 64 is just a way of passing bytes through a set of 64 characters. As this method takes a STRING parameter, those characters must be converted into bytes so that SAP is able to calculate the base 64 ; I guess the conversion into bytes is determined automatically by selecting the "charset" of the "Content-Type" HTTP header field (it's a problem if it's absent - maybe SAP will choose UTF-8).

To convert the ALV table into characters is another question; you may use the CSV format for instance (and then convert CSV into base 64).

Read only

RaymondGiuseppi
Active Contributor
2,257

Many tools already exist such as the FM ww_itab_o_html[,_headers,_layout] or classes cl_salv_[bs_runtime_info, ex_util, bs_tt_util to convert your ALV/itab to html, use search tool, those were already described in the forums.

Then encode the resulting string to Base 64.