cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Interactive form filled with data onto Application server

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

you could probably build in a method to FTP your file from your local machine to your app server.