Application Development 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: 

Print PDF in background

FredericGirod
Active Contributor
0 Kudos
643

Hi,

I need to print PDF in background. The PDF files will be stored in the server. The link is made in the MM01/02/03.

I think I can't use GL_GUI_PDFVIEWER, because it's a dialog object, is that right ?

Maybe I could use the CL_FP_PDF_OBJECT ?

If you have some advice or tips for that ...

Rgd

Frédéric

16 REPLIES 16

Former Member
0 Kudos
278

Hi

Did you found anything. I also would be interested to print pdf in background.

Regards

Rene

0 Kudos
278

check out the following weblog. this is for server side printing of BSP tableviews. but the logic in this weblog can be used for PDf documents as well.

/people/thomas.jung3/blog/2005/08/23/bsp-server-side-printing-for-tableviews

Regards

Raja

0 Kudos
278

Hi Rene,

I have found nothing new, I'm not anymore on this project.

Rgd

Frédéric

0 Kudos
278

Thanks Raja

But with 4.6c I have no idea how to use this. half of the objects are not even there. I probably need WebAs 6.40.

Regards

Rene

0 Kudos
278

Hi

I don't think you can do it, because PDF isn't an SAP Object. You should try to do that out of SAP.

I think SAP can only create or open a pdf file.

Max

0 Kudos
278

Hi All,

Can I create a PDF file in the background at least? I don't want to open it and print it but just want it to get created in background. Please help.

thanks in advance,

Sam.

0 Kudos
278

Hi,

Yes you can create a PDF file using the report.

You can convert the Report List output into PDF format.

I have created a report which creates a PDF file and send the PDF file as an attachement in the mail to varions users.

You can submit a program for displaying the output and export the same to SPOOL and that SPOOL request can be converted to PDF object. following is the FM which does it.<b>CONVERT_ABAPSPOOLJOB_2_PDF</b>

cheers

0 Kudos
278

Hi Sabari,

Converting to a PDF can be done as you've said in foreground. But here my requirement is different. I need to run a program in background that'll call some sapscripts and that sapscrpt output has to be converted to PDF files but not stored in the application server but in my local PC. That's where the catch is. Right now I've achieved making the program creating the text file in my local computer. But creating a PDF in my local comp cannot be done since the WS_DOWNLOAD FM doens't work for remote access.

Cheers,

Sam

0 Kudos
278

Hi

If you register your PC with sm59 at the sap server your are able to run the program in the background and still create the files locally with ws_download, but this will run only on the PC which you have registered and therefore the server knows it.

If this helps, then I can give you more details.

Regards

Rene

0 Kudos
278

I had this problem:

- create a job who read all print spools of a day, converted them to pdf file and tansfert them to certain server.

I solved copyng and updating the std prog RSTXPDFT4, I changed only the ABAP code to download the file: I used the statament

OPEN DATASET instaed of fm GUI_DOWNLOAD (or WS_DOWNLAOD):

OPEND DATASET <PATH>/MY_FILE.PDF>............

After the files were transfered to server by FTP command (see prg RSFTP*).

It was easy but it worked.

I hope It's helpfull for you

Max

0 Kudos
278

Hi Rene,

I think I'm doing the way you've mentioned only. I have an RFC destination registered in the server which is running in my local computer. I'm able to create a .txt or .xls file from the contents of an internal table that has the OTF data of a sapscript page. I'm using the FM RFC_REMOTE_FILE with the destination that I've created for my local pc. Now, when I'm using the same FM for creating the .PDF file, it still creates the files in my local comp but they are corrupt .PDF files. They can't be opened at all. WS_DOWNLOAD FM only can create proper PDF files but only in foreground. When run in background it errors out. What is the alternative I can do here?

Thanks in advance,

Sam

0 Kudos
278

Hi Max,

Your approach is quite new for me (FTP stuff). Can please guide me how to go about for my issue here since I'm not reading any spool info here.

Thanks in advance,

Sam

0 Kudos
278

Hi Sam

You're right! I've forgotten the real problem (to read and print a pdf file) while writing my answer.

Anyway I used that solution for saving a pdf file in background mode.

Max

0 Kudos
278

Hi Sabari,

I have managed to download the file from spool request to SERVER in pdf format.

My requirement is downloaded spool request (pdf file ) need to transfer on local PC to further processing. total file size is more than 180 mb

What is best solution to download the big size file from Application server to local pc... as well as is there any option to download into local pc directly using background option.

Thanks and Regards

Vijay

0 Kudos
278

We have linux app servers and unix database. We installed ACROREAD 5.0 (7.0 doesn't work with linux) on our app servers.

<u>On APP server with NFS drive, run:</u>

concatenate 'acroread -toPostScript -shrink'

'/sapif/pdfprint/spec1.pdf'

into unix_command

separated by space.

*

call 'SYSTEM' id 'COMMAND' field unix_command

id 'TAB' field unix_output-sys.

<u>On Database server run:</u>

concatenate 'lp -d lp' '8085' into unix_command.

concatenate unix_command '/sapif/pdfprint/spec1.ps'

into unix_command separated by space.

call 'SYSTEM' id 'COMMAND' field unix_command

id 'TAB' field unix_output-sys.

-Tim

0 Kudos
278

Max,

Can you post the complete code please? I have the same

requirement.

Thanks,

Alex.