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.
Showing results for 
Search instead for 
Did you mean: 

Print attachment from IW32

Former Member
0 Kudos

Hi All,

to print attachments from IW32, an enhancement is created & downloaded the attachments to PC

Then printing it using method   cl_gui_frontend_services=>execute

But the problem is its printing to Windows Default printer instead of printing to the printer given on IW32 order print popup ..

Appreciate the help


Active Contributor
0 Kudos


Hope u r writing code like this

call method cl_gui_frontend_services=>get_sapgui_workdir


sapworkorder = ....  " filename


Then hope ur desired printer will be chosen at the time of print.



0 Kudos

Exactly I'm writing it this way only

But the instead of output going to LOCL /SAP printer .. print is going to PC default printer set...

how to pass printer name explicitly to avoid the print to PC default printer??

0 Kudos


I think in program u have nothing to do,

U have to make a network printer

talk to ur administrator/basis person.

In our project we faced same problem

after make the printer

In desktop make your default printer as Network Printer from control panel and also in user profile>own data  IN SAP make printer name .

Then hope ur print will come properly.



0 Kudos

Thanks Gourav for the reply.

What you suggested is definitely one way. But what if the user is adamant and he wants to get the result through coding?

Is there any other ways through which we can print it to SAP printer??

As the attachment could be of any format say tif/bmp/jpeg/word/excel...

Can i Upload the data to application server and print from it?? is there a solution?

0 Kudos


Point wise i am trying to give answer

1)In Sap end user i hope not full illiterate, the printer settings generally done by admin or basis for one time,then the end users go for print only from next time.

2)Attachment  purpose(xls/word -other) there are many thread i think please search

for pdf if print options are there,try with pdf and just write PDF! in command prompt after print preview .no need to write any is the shortest solutions.

and press enter it will give u save,upload,print options.

3)Explicitly printer define I do not know.

If You think U found your answer In This thread

Please close this thread