Http://www.sapfans.com/forums/viewtopic.php? F = 13 & t = 324672
Have a look at program sap_pai_viewer_demo. This has a 'print' method.
If you don't want to go to all the trouble of using the PDF viewer you can always use gui_execute to run acrobat with A/P option.
However, if you are trying to do what I was which is to print a sequence of events note that the print spooler used is the local PC's Spooler rather than the sap Spooler so your PDF can be printed at any time and not neccesarily in the sequence that you send the prints from SAP. it cocould also be printed on a totally different printer dependant on the users printer settings.
-----------------------------------------------------
I have a PDF file in "C :/".
Printed PDF file using cl_gui_frontend_services => execute.
When PDF file prints then it opens the Acrobat Reader and the program waits until I close the Acrobat Reader.
Cocould you please let me if any options is there without open the PDF file or if it opens don't wait for the close (automatically closed ).
-----------------------------------------------------
Have you got succeed to print a PDF directly from sap?
And is it the same Principe with Excel file and Word file?
You'll see that he is using the method of running Acrobat Reader and using a command line option to print the file.
As for Word and Excel files, use OLE.
I have still a problem to print a PDF in SAP.
The fact is that my file is not on my PC but on a server which it's necessary to connect to reach it, have you a idea to help me?
And have you know the DOS command to print a file (Excel and Word) from SAP.
Http://forums.sdn.sap.com/message.jspa? Messageid = 8715149
I want to print PDF file from desk top using cl_gui_frontend_services => execute. My issue is the PDF file will be open but not printing. Can you please advide me how to call this method.
Call method cl_gui_frontend_services => Execute
Exporting
* Document = lv_dir
Application = 'your rd32.exe'
Parameter = 'C:/test. pdf'
Minimized = 'X'
* Synchronous =''
Operation = 'print'
Exceptions
Cntl_error = 1
Error_no_gui = 2
Bad_parameter = 3
File_not_found = 4
Path_not_found = 5
File_extension_unknown = 6
Error_execute_failed = 7
Synchronous_failed = 8
Not_supported_by_gui = 9
Others = 10.
-----------------------------------------------------
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
* document = lv_dir
application = 'AcroRd32.exe'
parameter = '/p /h C:/YourPDFile.pdf' "P = Print, h = Hide Window
minimized = 'X'
* synchronous = ' '
operation = ''
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10 .
Look also at URL http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm
-----------------------------------------------------
Look at
PrintMethod in program
Sap_pai_viewer_demoCl_gui PDF viewer => Print
Http://wiki.sdn.sap.com/wiki/display/ABAP/Working+with+files#Workingwithfiles-OLE%2FDOIforOfficenativefiles%28Excel%2CWord%2Cetc.%29
Http://www.sap-img.com/bc037.htm
Auto convert sap spool output to PDF File
Http://sap.ittoolbox.com/groups/technical-functional/sap-abap/print-pdf-file-2230035