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

Save spool pdf to server

Former Member
0 Likes
1,324

Hi

I have created a program, that can merge a service order and an invoice into one pdf., and then download it into my local drive (C:/).

1) The spool from the service order is converted into otf.

2) The spool from the invoce is converted into otf.

3) The otf data from both service order and invoice will be collected into one table.

4) and 5)

Then I call the FM: CONVERT_OTF_2_PDF

and then cl_gui_frontend_services=>gui_download

Above will download the file to my local drive.

But how to download to a library on my SAP server (found in AL11).

At the momenet I just got a lot of lines with informations about Type/Font/Subtype/LastChar/FirstChar etc. in my file on the server.

There is no pdf file, even that the name of the file is 1234_1233.pdf

I am doing as described in 1) + 2) + 3)

and then callling FM "CONVERT_OTF", from where I got the value from the importing parameter BIN_FILE (lv_pdf_file)

open dataset fnam for output in binary mode message msg.

transer lv_pdf_file to fnam.

close dataset fnam.

Anybody who can help, how to get my pdf downloaded into the server?

Thanks,

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,056

I think you should use FM CONVERT_OTF_2_PDF to get table LINES (of type TLINE) for given OTF format. Then transfer this table LINES content as you already do.

Regards

Marcin

Hi

I have created a program, that can merge a service order and an invoice into one pdf., and then download it into my local drive (C:/).

1) The spool from the service order is converted into otf.

2) The spool from the invoce is converted into otf.

3) The otf data from both service order and invoice will be collected into one table.

4) and 5)

Then I call the FM: CONVERT_OTF_2_PDF

and then cl_gui_frontend_services=>gui_download

Above will download the file to my local drive.

But how to download to a library on my SAP server (found in AL11).

At the momenet I just got a lot of lines with informations about Type/Font/Subtype/LastChar/FirstChar etc. in my file on the server.

There is no pdf file, even that the name of the file is 1234_1233.pdf

I am doing as described in 1) + 2) + 3)

and then callling FM "CONVERT_OTF", from where I got the value from the importing parameter BIN_FILE (lv_pdf_file)

open dataset fnam for output in binary mode message msg.

transer lv_pdf_file to fnam.

close dataset fnam.

Anybody who can help, how to get my pdf downloaded into the server?

Thanks,

4 REPLIES 4
Read only

StMou
Active Participant
0 Likes
1,056

Hi,

see with this Function Module DX_FILE_WRITE.

Rgds

Read only

MarcinPciak
Active Contributor
0 Likes
1,057

I think you should use FM CONVERT_OTF_2_PDF to get table LINES (of type TLINE) for given OTF format. Then transfer this table LINES content as you already do.

Regards

Marcin

Read only

0 Likes
1,056

It doesn't work.

I just got a long string into the file.

My file is named xxx.pdf, but it is not a pdf document.

Any other ideas?

Read only

0 Likes
1,056

The problem was, that it is not possible to see the pdf directly from transaction AL11.

I used the transaction CG3Y to move the file from the server to my desktop, and there I can see the pdf file.

Solved

Thanks for the input.