Showing results for 
Search instead for 
Did you mean: 

WF_DOC or SOFM to document in DMS.

Former Member
0 Kudos

Hello all.

I have a workflow that at some point has an instance of a workflow document (MS Word), Object type WF_DOC. It is possible to convert that to a SOFM object instance.

I want to be able to create a document in DMS and place this MS Word file in the DMS document. It is possible to use function module BAPI_DOCUMENT_CREATE2 to create documents in DMS, but this function module expects that any files that will be part of the document, come from a local or network drive.

Any ideas?



Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Just for the record, I will give the highlights of the way the problem was solved.

I did not find a way to checkin the word file in WF_DOC format into the DMS document. I had to save it in a local drive and use this saved file to checkin.

1. Get the contents of the file in WF_DOC format using SWUO_GET_DOCUMENT_CONTENT.

2. Prepare table with binary contents of Word document

FORM prepare_contents .

DATA: w_contents TYPE LINE OF solix_tab,

w_target TYPE sdokcntbin.

LOOP AT lt_contents INTO w_contents.

MOVE w_contents-line TO w_target-line.

APPEND w_target TO lt_target.


ENDFORM. " prepare_contents

3. Download file to local drive using METHOD cl_gui_frontend_services=>gui_download

4. Create the DMS document using BAPI_DOCUMENT_CREATE2

5. Check in the file in the local drive using BAPI_DOCUMENT_CHECKIN2

6. Delete the file in the local drive with METHOD cl_gui_frontend_services=>file_delete.

Active Contributor
0 Kudos

I haven't tried it myself, but I have just spent most of today debugging the DMS system to figure out a problem that only occurs in our test system.

Would not BAPI_DOCUMENT_CHECKIN2 be what you are looking for?

Former Member
0 Kudos

Thanks Kjetil.

I did not notice this function mudule. Its parameter DOCUMENTFILES has some data types that resemble something I have seen in connection with the objects in the workflow. I will try it and post my results.