0% found this document useful (0 votes)
128 views

File From Mime - WDABAP

This document defines variables to store information about an object, file, and content. It then loads the file content into variables, converts it to a string, and attaches it to the response with the file name and mime type.

Uploaded by

hobinthomas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views

File From Mime - WDABAP

This document defines variables to store information about an object, file, and content. It then loads the file content into variables, converts it to a string, and attaches it to the response with the file name and mime type.

Uploaded by

hobinthomas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

DATA ls_io TYPE skwf_io. DATA lt_data TYPE sdokcntbins. DATA lv_filename TYPE string.

DATA lv_lang TYPE sy-langu. DATA lv_size TYPE i. DATA lv_content TYPE xstring. DATA lv_mimetype TYPE mr_mimtype. DATA lv_mimestr TYPE string. ls_io-objtype = 'L'. ls_io-class = 'M_APP_L'. ls_io-objid = '526851D932F20A90E1008000AC100129'. lv_lang = 'EN'. cl_wb_mime_repository=>load_mime( EXPORTING io = ls_io check_authority = 'X' IMPORTING bin_data = lt_data filename = lv_filename filesize = lv_size mimetype = lv_mimetype CHANGING language = lv_lang ). lv_mimestr = lv_mimetype. CALL FUNCTION 'SCMS_BINARY_TO_XSTRING' EXPORTING input_length = lv_size FIRST_LINE = 0 LAST_LINE = 0 IMPORTING buffer = lv_content TABLES binary_tab = lt_data EXCEPTIONS FAILED = 1 OTHERS = 2 . cl_wd_runtime_services=>attach_file_to_response( EXPORTING i_filename = lv_filename i_content = lv_content

* *

* * *

i_mime_type = lv_mimestr i_in_new_window = abap_false ).

You might also like