on 03-24-2009 6:33 AM
Hi All,
I am able to save Interactive PDF filled with data on my local machine.But my requirement is to save it onto the application server.Could you please help me out.
Thanks in Advance,
Praveena
Hi Praveena,
Use Function Module to CONVERT_OTFSPOOLJOB_2_PDF
Or make use of this code :
CONSTANTS: c_no(1) TYPE c VALUE space,
c_device(4) TYPE c VALUE 'locl'.
PARAMETERS: p_file TYPE LOCALFILE DEFAULT TEXT-F02 OBLIGATORY.
DATA: gd_buffer TYPE STRING OCCURS 0 WITH HEADER LINE.
lt_conv LIKE gd_buffer OCCURS 0 WITH HEADER LINE.
DATA lv_string TYPE string.
* CONVERT TO PDF FORMAT
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = itab-sp_numb
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.
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING '~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~'.
APPEND gd_buffer.
DO.
counter = strlen( gd_buffer ).
IF counter GE 255.
lt_conv = gd_buffer(255).
APPEND lt_conv.
SHIFT gd_buffer LEFT BY 255 PLACES.
ELSE.
lt_conv = gd_buffer(counter).
APPEND lt_conv.
EXIT.
ENDIF.
ENDDO.
IF lt_conv[] IS NOT INITIAL.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
IF sy-subrc 0.
MESSAGE e398(00) WITH 'Error creating file' p_file.
ENDIF.
LOOP AT lt_conv INTO lv_string.
TRANSFER lv_string TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
IF sy-subrc EQ 0.
ELSE.
MESSAGE e398(00) WITH 'Error closing file' p_file.
ENDIF.
ELSE.
MESSAGE e398(00) WITH 'Error creating file' p_file.
ENDIF.
ENDIF.
Thanks,
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you could probably build in a method to FTP your file from your local machine to your app server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.