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

Printout a PDF document

Former Member
0 Likes
1,300

Hi together,

perhaps anybody have an idea: I need to print out pdf documents within SAP. The PDF files are attached to the order document and are stored in the archive.

I know that it give professional solutions to print different document formats. But I think it must give a function module (or different function modules) which can read the PDF from SAP archive and print it on a PostScript Printer.

Any idea? Thank for your help.

Regards Thomas

8 REPLIES 8
Read only

venkata_ramisetti
Active Contributor
0 Likes
1,063

Hi Thomas,

Are you mentioning about archived documents for process order (Transaction COEBR)?

Thanks

Ramakrishna

Read only

0 Likes
1,063

Hi Ramakrishna,

I'm not in process orders - I'm working with sales orders. Have you any idea how to print out the attached PDF-Files?

Thanks and regards

Thomas

Read only

0 Likes
1,063

Hi

Try to see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/25/6fa8fd27837846990a7a6813b06f80/content.htm">here</a>, perhaps it can be helpful.

Max

Read only

Former Member
0 Likes
1,063

Hi Thomas,

i make an download as PDF and start Acrobat wit /P /H.

Here a code example:

Download the file as C:\TEST.PDF.

DATA: PROGRAM(128) TYPE C.

  • Path of PDF

CALL FUNCTION 'SO_PROGNAME_GET_WITH_PATH'

EXPORTING

DOCTYPE = 'PDF'

IMPORTING

PATHNAME = PROGRAM

EXCEPTIONS

PATH_NOT_FOUND = 1

PROGRAM_NOT_FOUND = 2

NO_BATCH = 3

X_ERROR = 4

OTHERS = 5.

*

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

<b> COMMANDLINE = '/p /h C:\TEST.PDF'</b> PROGRAM = PROGRAM

EXCEPTIONS

FRONTEND_ERROR = 1

NO_BATCH = 2

PROG_NOT_FOUND = 3

ILLEGAL_OPTION = 4

GUI_REFUSE_EXECUTE = 5

OTHERS = 6.

Hope it helps.

Regards, Dieter

Read only

0 Likes
1,063

@max: this doesn't work for us because we are not on WAS 6.40

@dieter: we just try it. I think the problem will that it works in background-process (print output with output control). Does it work in background in your application?

Regards Thomas

Read only

0 Likes
1,063

Hi Thomas,

yes, we use it in background for purchase Order,

but not in an background-Job because

the workstations must be ON.

regards, Dieter

Read only

Former Member
0 Likes
1,063

Hi together,

I solved the problem by myself. After searching on different places I have to recognize that SAP isn't able to print a PDF-File which is attached i.e. on a purchase order.

So we convert the PDF-File with ghostscript to PS (PostScript) and than import it to SAP and create a DIS. All this happen in background - the user have nothing to do.

With the function modules RZL_READ_FILE and RSPO_OUTPUT_POSTSCRIPT we send the stream to the postscript printer. Only one small modification in the function module RSPO_OUTPUT_POSTSCRIPT was necessary to print the job in the background.

Regards Thomas

Read only

0 Likes
1,063

Hi Thomas,

can you give me a clue for printing the pdf document with the function modules RZL_READ_FILE and RSPO_OUTPUT_POSTSCRIPT

Thanks

Axel