cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2

Former Member
0 Kudos

Hi experts,

I'm getting problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2.

I have a scenario where is defined the document type ZC1, document part 200, authorization group 0002 and for all of these documents the storage category "Cofre DMS1". And the status which demands the storage category is 'FR'.

I've been fullfiling the BAPI_DOCUMENT_CREATE2 in this way:


"Tables
data: it_doc like bapi_doc_draw2,
      it_return like bapiret2,
      it_files like bapi_doc_files2 occurs 0 with header line,
      it_objs like bapi_doc_drad occurs 0 with header line.

"Variables
data: wl_doctype like bapi_doc_draw2-documenttype,
      wl_docnumber like bapi_doc_draw2-documentnumber,
      wl_docpart like bapi_doc_draw2-documentpart,
      wl_docversion like bapi_doc_draw2-documentversion.

it_doc-documenttype = 'ZC1'.
it_doc-documentpart = '200'.
it_doc-documentversion = '00'.
it_doc-description = 'Test of documents creation via BAPI'.
it_doc-username = sy-uname.
it_doc-statusextern = 'FR'.
it_doc-authoritygroup = '0002'.

refresh it_files[].
clear it_files.

it_files-originaltype = '1'.
it_files-storagecategory = 'Cofre DMS1'.
it_files-wsapplication = 'PDF'.
it_files-docfile = 'c:\110307.pdf'.
it_files-description = 'Test file'.
append it_files.

refresh it_objs[].
clear it_objs.

it_objs-objecttype = 'EKPO'.
it_objs-objectkey = '47000497600010'.
append it_objs.

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
  EXPORTING
    documentdata = it_doc
  IMPORTING
    documenttype = wl_doctype
    documentnumber = wl_docnumber
    documentpart = wl_docpart
    documentversion = wl_docversion
    return = it_return
  TABLES
    objectlinks = it_objs
    documentfiles = it_files.

After execute the BAPI process I got the following error:

E26 087 - Data carrier COFRE DMS1 not defined

Does anybody have a sugestion to help me, please?

Thks

David

Edited by: David Tsutsui on Mar 18, 2010 10:52 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Please refer to this thread, it tells why you need a data carrier you can also configure the same in DC20.