2013 Oct 22 1:46 PM
Hello Guru's,
I need to print some pdf documents store on my sap server (not created by SAP programs).
Is this is possible and how ?
Thanks a lot.
JC
2013 Oct 24 9:49 AM
Hello Jean-Claude,
actually there is a possibility to use "normal" SAP backend printers to print PDF files from SAP spooler. The prerequisite for this is that these printers are attached to SAP backend appserver via a Windows print server which runs the SAPSprint print service software (i.e. you need to print via the SAPSprint service, not directly to the printer).
There is an optional software component PDFPRINT which allows SAPsprint to convert an incoming PDF to printer output using the Windows Printer driver. You can find the information on how to get PDFPRINT in SAP note 1444342.
What you actually need to do on the application side is to create a spool request (which contains your PDF file) which "looks like" a PDF spool request created from SAP Interactive Forms by Adobe (IFbA). I believe this is what FP_JOB_OPEN...FP_JOB_CLOSE mentioned above are about, but these are internal funcs and I cannot advise on how to use them.
In newer versions of SAP NW 7xx (newer SPs) you can find the new function module ADS_CREATE_PDF_SPOOLJOB which does all the required work for you.
Best regards,
Alexander
2013 Oct 22 3:30 PM
2013 Oct 23 11:27 AM
Thanks Glen,
"To print PDF to a SAP printer is not directly possible but to a frontend printer will be."
But this solution is not possible, we are working only in batch mode, and we have no frontend printer define in our project
Is there another possibility ?
Thanks a lot.
JC
2013 Oct 23 1:02 PM
Apologies, I don't know of any other way.
Hopefully one of the others here can provide solution.
2013 Oct 23 11:33 AM
You can use OPEN DATASET, WRITE TO...., CLOSE DATASET...
-Sowmya
2013 Oct 23 12:15 PM
Thanks Sowmya,
But the write is not working for PDF, do you have another idea ?
Thanks a lot.
JC
2013 Oct 23 12:50 PM
This is how I've used and it is working for me..
DATA: w_output_record(700) TYPE c.
“p_ofile is the Output File Path
IF p_ofile IS NOT INITIAL.
OPEN DATASET p_ofile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
WRITE: / 'Could not open file ', p_ofile.
STOP.
ENDIF.
ELSE.
WRITE: / 'No file'.
STOP.
ENDIF.
WRITE: '$$LW00PMFF[ATEST$$' TO w_output_record. "ASCII/EBDCIC Files
TRANSFER w_output_record TO p_ofile.
CLOSE DATASET p_ofile.
IF NOT sy-subrc IS INITIAL.
MESSAGE e999(z1) WITH 'Could not close file:' p_ofile.
ENDIF.
Regards,
Sowmya
2013 Oct 23 3:14 PM
Thanks Sowmya,
It seemes that your code is not working for me, I only need to print de PDF and add it to an existing spool.
Thanks
2013 Oct 23 12:02 PM
Hi,
You can solve your problem using following steps.
(1) Use OPEN DATASET ...... CLOSE DATASET (For Communication with Server)
Between OPEN DATASET and CLOSE DATASET, You have to use following Function Modules
(2) Use GUI_UPLOAD Function Module (For Reading(Upload) PDF data in Internal Table)
(3) Use GUI_DOWNLOAD Function Module (For Writing(Download) PDF data on Presentation Server)
With Thanks & Regards,
Tushar Trivedi.
2013 Oct 23 12:16 PM
Hello Tushar,
The PDF files is not on presentation server, and all the process will be in background, thus GUI FM are not working
Thanks for yur help.
JC
2013 Oct 23 12:46 PM
Hi Jean,
Hope the link might be useful.
http://scn.sap.com/thread/2114729.
Revert back if it is not working.
With Regards,
Giriesh M
2013 Oct 23 3:07 PM
Thanks Giriesh,
This is not the solution for me, because we need only print in background, and thus avoid the gui function or object.
Thanks.
JC
2013 Oct 23 3:40 PM
Hi,
If you are using a costume program to generate the form then may be you are using FP_JOB_OPEN function module. In that pass the changing parameter ie_outputparams with REQNEW = 'X'. It will create a spool for you. If you are not using FP_JOB_OPEN then please let me know how you are generating the PDF then may be I can give you alternate solution.
Regards,
Supratik
2013 Oct 23 3:50 PM
Hello Supratik,
The PDF files are coming from different sources (scan document, mail attach, ..., and are store temporaly on a work folder on my SAP folder.
I need to add those files to a existing spool.
I have already managed the field REQNEW in the print of the document to allow the adding of new documents in the spool.
But how can ake my PDF file from my SAP server, and add it to the spool.
Thanks a lot.
JC
2013 Oct 23 3:58 PM
Hi JC,
If you want to add that to a existing spool then no need to use REQNEW ,as it will create a new spool for that. In that case just pass the existing spool number to SPOOLID of ie_outputparams. Hope this helps.
Regards,
Supratik
2013 Oct 24 9:01 AM
Hi Supratik,
My question is : how to send a pdf file from sap server to spool ?
How to print a pdf document file ?
Thanks a lot.
JC
2013 Oct 24 9:49 AM
Hello Jean-Claude,
actually there is a possibility to use "normal" SAP backend printers to print PDF files from SAP spooler. The prerequisite for this is that these printers are attached to SAP backend appserver via a Windows print server which runs the SAPSprint print service software (i.e. you need to print via the SAPSprint service, not directly to the printer).
There is an optional software component PDFPRINT which allows SAPsprint to convert an incoming PDF to printer output using the Windows Printer driver. You can find the information on how to get PDFPRINT in SAP note 1444342.
What you actually need to do on the application side is to create a spool request (which contains your PDF file) which "looks like" a PDF spool request created from SAP Interactive Forms by Adobe (IFbA). I believe this is what FP_JOB_OPEN...FP_JOB_CLOSE mentioned above are about, but these are internal funcs and I cannot advise on how to use them.
In newer versions of SAP NW 7xx (newer SPs) you can find the new function module ADS_CREATE_PDF_SPOOLJOB which does all the required work for you.
Best regards,
Alexander
2013 Oct 25 8:31 AM
Thanks Alexander,
I have to install the OSS Note 1855522 to have this FM.
I'll let you know if it works.
Thanks and regards
JC
2013 Oct 25 9:16 AM
Dear Alexander,
You are the king, now it works fine after implementing the oss Note 1855522.
Thanks a lot.
JC