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

how to convert Attachment into a spool request ?

Sudhakargadde
Participant
0 Kudos

Hello ,

i am attached an attachment in ME22N tcode,

my requirement is when i click the print in it the print goes to spool as well as the attachment is also created in spool.

Please help me out guys,

Thanks and regards

Sudhakar

9 REPLIES 9

Former Member
0 Kudos

Can you be a little more clear with what you need? What do you need to convert and to what does it need to be converted to?

Former Member
0 Kudos

Please elabrate what you are doing and your expected result..

0 Kudos

Hello Vikram \ Shandrakanth,

my Question is when ever i give a print of Purchase order the relevent Smartform is printed and after the my attachment is printed. but it works fine its printed.

But the attachment is downloaded to the presentation system and then it goes to the printer after print it was deleted from the presentation system fine. for reading of attachment i used some function module are mentioned below.


BDS_GOS_CONNECTIONS_GET

SO_OBJECT_READ

SO_OBJECT_DOWNLOAD

so now my requirement is, i need to generate a spool request for the attachment for printing not to download the into presentation system. how can i do that? Help me out of it

Thanks and Regards

Sudhakar

arindam_m
Active Contributor
0 Kudos

Hi,

Check the Class CL_GOS_DOCUMENT_SERVICE method EXPORT_ATTACHMENT. You can export the attchement to a temp folder in your frontend and then read it and send it for printing which will create the spool for the attchement.

You can delete the file after your over with the processing from the temp folder using a EXTERNAL COMMAND.

Cheers,

Arindam

0 Kudos

Hi Arindam,

It will be great, if you offer us the sample code for this class. And procedures to make it happen.

matt
Active Contributor
0 Kudos

He's given you enough information. It is not permitted to ask for sample code here.

0 Kudos

But I kind find way of  deleting the file  from the temp folder by an EXTERNAL COMMAND,  what external command.  And what processing.

arindam_m
Active Contributor
0 Kudos

Hi,

For deleting file from presentation server use FM:

GUI_DELETE_FILE

For deleting file from app server you can use external command. Check the link to know more on same.


http://help.sap.com/saphelp_nw70/helpdata/en/c4/3a8023505211d189550000e829fbbd/content.htm

Cheers,

Arindam

0 Kudos

hi Hai Wang,

Use the Class CL_GUI_FRONTEND_SERVICES it will help you so many ways to work with folder and files in the presentation System. read documentation as well as every method description of this class you can understand better, all most all are static methods you can use them very easily wang.

Thanks And Regards

Sudhakar