on ‎2016 Dec 22 1:02 PM
How to print pdf document which is contained in XSTRING format ?
Request clarification before answering.
Hi,
I achieved this using some RSPO_SR_... function modules. Here is my code:
DATA: l_dest TYPE sypri_pdest,
l_spool_handle TYPE i,
l_spoolid TYPE tsp01-rqident.
l_dest = 'WIN'.
CALL FUNCTION 'RSPO_SR_OPEN'
EXPORTING
dest = l_dest
layout = 'G_RAW'
* name = sponame
suffix1 = 'BIN'
suffix2 = sy-uname
immediate_print = 'X'
auto_delete = 'X'
doctype = 'BIN'
IMPORTING
handle = l_spool_handle
spoolid = l_spoolid
EXCEPTIONS
OTHERS = 1.
DATA: raw_buffer TYPE TABLE OF rspolpbi.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = x_content
TABLES
binary_tab = raw_buffer.
CALL FUNCTION 'RSPO_SR_TABLE_WRITE_BINARY'
EXPORTING
handle = l_spool_handle
* CODEPAGE =
total = x_size
TABLES
lines = raw_buffer
EXCEPTIONS
handle_not_valid = 1
operation_failed = 2
OTHERS = 3.
CALL FUNCTION 'RSPO_SR_CLOSE'
EXPORTING
handle = l_spool_handle
* PAGES = 1
final = 'X'
EXCEPTIONS
handle_not_valid = 1
operation_failed = 2
OTHERS = 3.
where X_CONTENT is the XSTRING varaible where I have my PDF in binary and X_SIZE is type I with the size (in bytes) of the PDF.
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello!
I face the same problem. Have you solved it?
Best Regards!
Rui
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.