We can use the below function modules to convert text/attachments(pdf,word doc,excel) files to XSTRING format and then later open them as original document.
First convert the Document as Binary. That we can find easily.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length =
first_line =
last_line =
importing
buffer =
tables
binary_tab = l_content_bin
exceptions
failed = 1
others = 2.
call function 'SCMS_FTEXT_TO_XSTRING'
exporting
input_length =
first_line =
last_line =
mimetype =
importing
buffer =
tables
ftext_tab = l_content_txt
exceptions
failed = 1
others = 2.
call function 'SCMS_TEXT_TO_XSTRING'
exporting
first_line =
last_line =
mimetype =
importing
buffer =
tables
text_tab = l_content_txt
exceptions
failed = 1
others = 2.
To open the document from a Webdynpro abap window, try the below code.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = lv_text
i_content = = l_content_bin / l_content_txt
i_mime_type = 'application/pdf'
i_in_new_window = ABAP_FALSE
i_inplace = ABAP_FALSE .
Here just pass the MIME TYPE based on your attachment.
application/octet-stream | Binary file. Default if data is primarily binary. |
application/postscript | PostScript (.ai, .eps, or .ps) file. |
application/base64 | Base64-encoded bytes. |
application/macbinhex40 | BinHex for Macintosh. |
application/pdf | Portable Document Format (PDF). |
application/xml | XML data. Must be server-supplied. See also "text/xml" type. |
application/atom+xml | Internet Explorer 7 and later. Atom Syndication Format feed. |
application/rss+xml | Internet Explorer 7 and later. Really Simple Syndication (RSS) feed. |
application/x-compressed | UNIX tar file, Gzipped. |
application/x-zip-compressed | Compressed archive file. |
application/x-gzip-compressed | Gzip compressed archive file. |
application/java | Java applet. |
application/x-msdownload | Executable (.exe or .dll) file. |
I’m wondering how I might be notified whenever a new post has been made. I’ve subscribed to your RSS feed which must do the trick! Have a great day! android app development
ReplyDelete