cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Attach a Document To a SAP Document

Former Member
0 Kudos

Hi Experts,

We would like to be able to automatically attach supporting documentation to a SAP document via our SAP content server so that the user do not have to open SAP. Is there any BAPI or RFC that would help us do that? If not, how would you approach this?

Thanks

Martin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Experts,

Although, would this post to the application server or our content server? I need to have the attach document store on the content server like the archive link solution would do.

Thanks for your feedback.

Martin

Former Member
0 Kudos

if you want to attach supporting documents to an existing DIR, then use bapi_document_change2 and pass document key and original file path, do call BAPI_TRANSACTION_COMMIT on succeful change..or implement the badi document_main01 method BEFORE_SAVE pass the original file information....

if you want to attach a file while document creation- then there are different ways to achieve this 1. implement above mentioned badi, 2. call bapi_document_create2, 3. set default ws application for document type - e.g doc and define templates for the original files in dc30 transaction...

Makal
Active Contributor
0 Kudos

There are more than one ways to do this.

You can use, BAPI_DOCUMENT_CREATE2 & pass following parameters to it:

DOCUMENTYPE

DOCUMENTNUMBER

DOCUMENTVERSION

DOCUMENTPART

USERNAME

STATUSEXTERN

STATUSINTERN

CADINDICATOR

CREATEDATE

Please refer for more details

Other way of achieving this is, use LSMW

I hope this is useful for you.

Regards

Amaresh Makal