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

Virtual Printer - Saving prints as a file

Former Member
0 Likes
5,963

Hi,

I need to setup a virtual printer such that, if anything is printed on that, it is saved as a file. This file sould contain printer instruction, which can then be sent to 3rd party for printing.

Something like Microsoft Document Imaging.

All this has to run in background.

Can anyone help?

Regards,

Vikas

1 ACCEPTED SOLUTION
Read only

sridhar_k1
Active Contributor
0 Likes
2,968

Here's how to set up a virtual printer:

Tx; SPAD-> create a device type -> in change mode clikck on access method tab -> from edit menu select Command set-> command set id field shows up -> enter a letter, for ex:A , Doubble click on the field-> give a description-> enter cp &F /tmp/vpfile in command to transfer print data field -> enter echo ok in the last field.

Host spool access method should be L in the printer definition.

When you print using this printer, the output file copied to /tmp/vpfile folder.

Regards

Sridhar

Message was edited by:

Sridhar K

10 REPLIES 10
Read only

Former Member
0 Likes
2,968

You can save spool requests as PDF documents and convert the print controls into an LPR command which when executed will print the PDF document to the printer specified. Is this what you mean?

Read only

Former Member
0 Likes
2,968

Hi Gill,

I do not want to save the spool as PDF.

I want to save that directly in printer language as a file.

Regards,

Vikas

Read only

sridhar_k1
Active Contributor
0 Likes
2,969

Here's how to set up a virtual printer:

Tx; SPAD-> create a device type -> in change mode clikck on access method tab -> from edit menu select Command set-> command set id field shows up -> enter a letter, for ex:A , Doubble click on the field-> give a description-> enter cp &F /tmp/vpfile in command to transfer print data field -> enter echo ok in the last field.

Host spool access method should be L in the printer definition.

When you print using this printer, the output file copied to /tmp/vpfile folder.

Regards

Sridhar

Message was edited by:

Sridhar K

Read only

0 Likes
2,968

Thanks Sridhar.

This solves the problem.

Regards,

Vikas

Read only

0 Likes
2,968

Can this be set up to output the file to a network folder?

Read only

0 Likes
2,968

Yes, you can copy to any network folder that is known to the sapservicesid user.

Another alternative is to create the command file on your network folder and pass the spool parameters to the command file. Instead of using the copy (cp) command on the command line in the command set, call the command file.

Example


server\folder\xyz.cmd &F &P &C &N &T

The parameters are : &F = filename. &P = printer name. &C = number of copies. &N = spool request number. &T = title.

Read only

0 Likes
2,968

Hi, How can i output a to a local drive on my pc or a network drive. I have created a virtual printer on SAP but not sure what command to save to my local drive.

Thanks

Read only

0 Likes
2,968

This method outputs a file in printer language? Is it possible to output a plain text file?

Read only

0 Likes
2,968

enter cp &F /tmp/vpfile in command to transfer print data field -> enter echo ok in the last field.

This worked perfectly, thanks!

Read only

0 Likes
2,968

Hi Sridhar,

I got a similar requirement to place the output of the printer into an AL11 directory for further processing. I did exactly what you have advised earlier but unfortunately failed to get a copy of the output on the AL11 directory.

Can you help advise what needs to be done? pre-requisites?

thanks!