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: 

output of PDF to system disc drive

Former Member
0 Kudos
537

Hi - We currently have a smartform that sends a email with a PDF attachment - anyone know how I can get sap to write the attachment to disc instead of send it in an email? I set up a "printer" that prints to a file instead of a printer - the output is not a PDF file - I need the PDF written to a directory....

Thanks muchly! Janet

1 ACCEPTED SOLUTION

Former Member
0 Kudos
159

Hi Janet,

If you have the PDF file, then you can download it using Function Module GUI_DOWNLOAD.

If you want to print the file in PDF format to local machine, then you can configure PDF Device in your SAP System.

You can use transaction SPAD to setup printer with PDF Device type.

This way you can write the file in PDF format to your local machine.

Tell me whether this helps you.

Best Regards + Greetings,

Sasi.

5 REPLIES 5

Former Member
0 Kudos
160

Hi Janet,

If you have the PDF file, then you can download it using Function Module GUI_DOWNLOAD.

If you want to print the file in PDF format to local machine, then you can configure PDF Device in your SAP System.

You can use transaction SPAD to setup printer with PDF Device type.

This way you can write the file in PDF format to your local machine.

Tell me whether this helps you.

Best Regards + Greetings,

Sasi.

0 Kudos
159

Sasi - Thank you - I choose the printer method and it works! Very Grateful! - Do you know how I can control the name of the file that is output? Janet

0 Kudos
159

Hello Janet !,

Yaeh.. of course you can control the name of the file that is output.

Printer method: When you say "Print" after you configured PDF Device in SPAD, it will automatically ask for file name and location to print.

Function Module GUI_DOWNLOAD: If you are using this Function module, you can specify the default file name and location which can be changed at run time.

Greetings + Warm Regards,

Sasi.

0 Kudos
159

Sasi - Not sure I understand - we have the printer configured in spad as a print to file - I would like to name the file at run time - when I call the smartform with the print to file PDF printer as the print device - can I also name the output file at that point? If no - when I call the smartform is there a way to get the file so I could then use the gui_download?

The key is - I need to be able to put a PDF file at a directory with a name that was generated during the run time....

Thank you very much for your help! Janet

0 Kudos
159

Yaeh Janet, You can very well name the file at run time.

After you configure PDF device type in SPAD, when you say print, it will automatically ask for File name and path. Hence you can name the file at run time also.

If you want to do in through code, you can do it as well.

I haven't worked on smart forms but I worked in SAPScripts in printworkbench and I had similar requirement.

In my case,

*I called a Function Module EFG_PRINT and got the data to be printed in a tables parameter.

*I passed this internal table to Function Module CONVERT_OTF (This FM converts OTF data to PDF) to convert it into PDF file.

*I gave a default name (Which can be changed at run time also) to the PDF and called Function Module GUI_DOWNLOAD to download this file to the disk (Location can be specified at run-time also)

Janet, just check in which table the data is present. if you got that, you can very well proceed with the above steps and achive the expected result.

Get back to me for any queries.

Best Regards + Greetings,

Sasi.