Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Convertion of Internal table data to PDF

Hi All,

I want to download the internal table data to PDF. Can any one tell how to convert the internal table data to PDF ?

Thanks and Regards,

Vishwa.

Former Member
replied

Hi Vishwanath,

and create Spool request for Internal Table or Output table..


CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
EXPORTING
dest = 'LOCL'
* LAYOUT =
* NAME =
* SUFFIX1 =
* SUFFIX2 =
* COPIES =
* PRIO =
* IMMEDIATE_PRINT =
* AUTO_DELETE =
* TITLELINE =
* RECEIVER =
* DIVISION =
* AUTHORITY =
* POSNAME =
* ACTTIME =
* LIFETIME = '8'
* APPEND =
* COVERPAGE =
* CODEPAGE =
* DOCTYPE =
IMPORTING
handle = v_handle
spoolid = gd_spool_nr
rc = v_rc
errmessage = v_errmessage.


LOOP AT i_mara.
v_text = i_mara-matnr.
CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
EXPORTING
handle = v_handle
text = v_text
* LENGTH =
* CODEPAGE =
* TRUNCATE =
IMPORTING
rc = v_rc
errmessage = v_errmessage
EXCEPTIONS
handle_not_valid = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


ENDLOOP.


CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
EXPORTING
handle = v_handle
IMPORTING
rc = v_rc
errmessage = v_errmessage
EXCEPTIONS
handle_not_valid = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

and convert ABAP spool to PDF..

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.

and Down load the PDF to desk top..

GUI_DOWNLOAD.

Regards,

Prabhudas

Edited by: Prabhu Das on Apr 16, 2009 7:24 PM

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question