Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Write PDF file into application server.

Former Member
0 Likes
796

Hi Gurus,

I have created a smartform and converted into PDF using function module as given below. Now I want to write this generated PDF file into application server. I am not generating any spool request too. How can I proceed from here? Pls advice..

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = lv_bin_filesize

TABLES

otf = ls_job_output_info-otfdata

doctab_archive = lt_docs

lines = lt_lines

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

OTHERS = 3.

Thanks..

Saj

4 REPLIES 4
Read only

Former Member
0 Likes
611

Hi,

Try using open dataset to write ur file into the application server. The following syntax might help u

OPEN DATASET 'urfilename.pdf' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

regards,

Ibrar

Read only

Former Member
0 Likes
611

How can I use OPEN DATASET becase which internal table should I write to file?

We have 3 internal tables exporting from above function module.

Read only

0 Likes
611

transfer all the data from ur itabs to one final itab declared as follow

DATA: BEGIN OF final_itab OCCURS 0,

document TYPE string,

END OF final_itab.

then finally,

OPEN DATASET 'yourfile.pdf' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

len = strlen( final_itab-DOCUMENT ).

TRANSFER final_itab-DOCUMENT TO 'yourfile.pdf' LENGTH len.

CLOSE DATASET 'yourfile.pdf'.

This ends the coding mate.

Enjoy it n have a good day.

Cheers

Read only

0 Likes
611

this doesn't work..one thing i understood it supposed to be in BINARY mode...