Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Create DATA-URL from xstring

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs

DATA lv_filetype TYPE char4.
DATA lv_content  TYPE xstring.

" get your data, for example a jpg
" lv_filetype = 'jpg'
" lv_content = ....

DATA(mimetype) = /iwwrk/cl_mgw_workflow_rt_util=>get_mime_type_from_extension( lv_filetype ).
DATA(base64)   = /iwwrk/cl_mgw_workflow_rt_util=>base64_encode( lv_content ).

DATA(lv_data_url) = |data:{ mimetype };base64,{ base64 }|.

Leave a Reply

Your email address will not be published. Required fields are marked *