‎2008 Jul 24 12:24 PM
hi,
I have the scenario like this. I have to convert the form(script or smartform) into pdf format and then that pdf format is to be stored in the application server.
Using the standard program 'RSTXPDFT4', one can convert the form into pdf format. But afterwards how to proceed to save it in the application server.Please help.
Rgds,
khadeer.
‎2008 Jul 24 12:31 PM
u can convert the otf data to pdf in the following way...Here wa_job_output_info u can get from the smartformcalling Function module
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
archive_index = wa_arc_idx
IMPORTING
bin_filesize = wf_numbytes
TABLES
otf = wa_job_output_info-otfdata
doctab_archive = tb_doctab_archive
lines = tb_lines
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
then use the tb_lines as given below..
OPEN DATASET wf_filename FOR OUTPUT IN BINARY MODE.
find an unique name for wf_filename.u can hard code the same.
IF sy-subrc EQ 0.
LOOP AT tb_lines.
TRANSFER tb_lines-tdformat TO wf_filename.
TRANSFER tb_lines-tdline TO wf_filename.
ENDLOOP.
ELSE.
wf_error = 'X'.
ENDIF.
CLOSE DATASET wf_filename.
IF sy-subrc NE 0.
wf_error = 'X'.
ENDIF.
‎2008 Jul 24 12:31 PM
u can convert the otf data to pdf in the following way...Here wa_job_output_info u can get from the smartformcalling Function module
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
archive_index = wa_arc_idx
IMPORTING
bin_filesize = wf_numbytes
TABLES
otf = wa_job_output_info-otfdata
doctab_archive = tb_doctab_archive
lines = tb_lines
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
then use the tb_lines as given below..
OPEN DATASET wf_filename FOR OUTPUT IN BINARY MODE.
find an unique name for wf_filename.u can hard code the same.
IF sy-subrc EQ 0.
LOOP AT tb_lines.
TRANSFER tb_lines-tdformat TO wf_filename.
TRANSFER tb_lines-tdline TO wf_filename.
ENDLOOP.
ELSE.
wf_error = 'X'.
ENDIF.
CLOSE DATASET wf_filename.
IF sy-subrc NE 0.
wf_error = 'X'.
ENDIF.