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: 

SE78 color bitmap image stored as text to BASE64 string

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I found a lot of information in similar discussions but I still didn't manage to solve my scenario, I hope you can help.

I want to get a color bitmap image stored as text in SE78 and convert it to a base64 string (to embed it in HTML).

I know how to read the image data with just READ_TEXT function. It retrieves a text table including comments but I don't know how is this formatted. So debugging SE78 preview function I found out that after reading the text it executes the following function to transform the ITF text image to BMP and store it in lt_image_binary table:

CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
                   EXPORTING
                     ITF_HEADER                     = lv_header
                     OLD_FORMAT                   = 'ITF'
                     NEW_FORMAT                  = 'BMP'
                   TABLES
                     ITF_LINES                     = lt_image_itf
                     bitmap_file                    = lt_image_binary
                   EXCEPTIONS
                     OTHERS                         = 1.


I tried to then to transform the binary table to string with SCMS_BINARY_TO_STRING but it is not working... I wanted to do that and then maybe use cl_http_utility, encode_base64 method to achieve my goal. But I'm doing something wrong and I'm not sure what yet.


Could you help me please? Thank you in advance.

1 REPLY 1

Marçal_Oliveras
Active Contributor
0 Kudos

Actually what I described in the initial message it works now... I must had something wrong and fixed later some how.