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 download a service object attachment to app server?

Former Member
0 Kudos
1,181

I found some postings / blogs to download an attachment (service objects).

This tells to download to local drive or to a mapped network drive .

How do I download to an applications erver?

Thanks,

Ven

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos
341

Hi check the Tr

tr: CG3Z

16 REPLIES 16

former_member156446
Active Contributor
0 Kudos
342

Hi check the Tr

tr: CG3Z

0 Kudos
341

CG3Z does not allow input of the parameters from a program - right?

but my question is to download the attachment directly to the application server -

0 Kudos
341

if you want to do programatically you need to know the path were you will save the file in app server and use open dataset <path>....

former_member194669
Active Contributor
0 Kudos
341

You need to use

call function 'SO_DOCUMENT_READ_API1'

then

call function 'SO_OBJECT_DOWNLOAD'.

It will work fine with binary object. but i am not sure how it will work with WORD & XLS files

0 Kudos
341

These seem to download to the local directory but I need to download to the application server - path statrts something like //sapmnt/work/.....

0 Kudos
341

if you are keeping WORD or XLS files in app server will not work.

0 Kudos
341

open dataset <path>.... is to download to app server which we can see using Tr : AL11

0 Kudos
341

I know OPEN DATE SET and all that stuff.

and it seems we are moving in another tangent.

I need to download Service Object Attachments to the app server. aR's reply is some what relevant but is not exactly relevant.

I am able to download to presentations erver by using the code:

  • This function module creates a file in the PC

CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'

EXPORTING

method = 'PUTCONTENTTOFILE'

office_user = sy-uname

TABLES

files = i_files

CHANGING

document = sw_document.

READ TABLE i_files INDEX 1.

MOVE:

i_files TO sw_document1.

However this does not seem to work to download on the app server.

0 Kudos
341

If you are writing a file to app server you have only 2 mode text & binary. This will not work fine with WORD or XLS files etic. My suggestion will be instead of puting files in app server put it in a shared drive or FTP server drive.

0 Kudos
341

You are right a@R - this helps but let me see if there are any other tools.

A quick update - you can upload or download a pdf file as BIN - probably we can do the same for word / excel files also without passing the type.

I tried a .csv extension and itwokred perfect with open dataset and transfer key words.

Edited by: Venkatabby on Nov 12, 2008 1:01 PM

0 Kudos
341

Thanks for sharing the info.

PS CSV extension is as same as TXT

0 Kudos
341

Hi,

I have a requirement wherein i have to retrieve the PDF attached to an open invoice. i can see the PDF attached for an invoice in service object attachment list in VF03. How can i retrieve this PDF? Any FM or methods are there to achive this functionality?

I saw your below reply....will these FM help me... can you explain for what these FM are used?

You need to use

call function 'SO_DOCUMENT_READ_API1'

then

call function 'SO_OBJECT_DOWNLOAD'.

It will work fine with binary object. but i am not sure how it will work with WORD & XLS files

Thanks,

Srilakshmi.

0 Kudos
341

PDF files can be downloaded as BIN type.

I used the following code

  • This function module creates a file in the PC

CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'

EXPORTING

method = 'PUTCONTENTTOFILE'

office_user = sy-uname

TABLES

files = i_files

CHANGING

document = sw_document.

Search here int eh forums with the keyword "attachment" - it will lead to a blog where it explaisn how to create all necessary elements to attach as well as download files.

0 Kudos
341

Dear Venkat ,

I am the same problem while downloading the pdf file to fileserver.

My requirement is to read the inbox and collect the attachment and move to fileserver.

After moving the attachment , inbox documents to be moved to personalised folder of sap office.

Everything is working perfect in foreground .

But in background it is not transferring the attched file to fileserver.

I have used the FM 'SO_DOCUMENT_REPOSITORY_MANAGER'

using method 'PUTCONTENTTOFILE'.

Regards,

Amitav

Former Member
0 Kudos
341

no answer - closing

0 Kudos
341

How to download a service object attachments to app server or a FTP server?

How did you do it ? Could you please send some code to me , zengyanAT318hotmailDOTcom

Thank you very much!

Martin Zen