Skip to Content
0
Former Member
Jun 19, 2014 at 07:08 AM

How to update characteristics of DMS document

450 Views

Hello, I have a requirement to update characteristics right after document creation.

I use BAPI_DOCUMENT_CREATE2 to create the document:

CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
     EXPORTING
       documentdata    = ls_doc
     IMPORTING
       documenttype    = lv_document_type
       documentnumber  = lv_document_number
       documentpart    = lv_document_part
       documentversion = lv_document_version
       return          = ls_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.


And then when I try to change it:


CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
     EXPORTING
       documenttype         = iv_document_type
       documentnumber       = cv_document_number
       documentpart         = iv_document_part
       documentversion      = iv_document_version
       documentdata         = ls_document_data
       documentdatax        = ls_document_data_x
     IMPORTING
       return               = ls_return
     TABLES
       classallocations     = lt_cl_alloc
       characteristicvalues = lt_char.


The following error is raised: Object TYPE/NUMBER/PART/VERSION does not exist.


I pass the type, number, part and version right from BAPI_DOCUMENT_CREATE into corresponding arguments for the second call, and into documentdata fields as well. ClassAllocations table contains a single row with class type and name for characteristics in CharacteristicValues table.


Could you suggest me, what can be wrong here?