Application Development and Automation 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: 
Read only

BAPI for DMS

Former Member
0 Likes
2,462

How do I update DMS characterstic values?

I tried using BAPI_DOCUMENT_CHANGE2, but the characterstic value is not getting updated.

Does anyone have a working example of how to use the BAPI to update Document characterstic values?

Thanks in advance, for your help.

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,527

Hello

Have you called BAPI_TRANSACTION_COMMIT after successfully calling BAPI_DOCUMENT_CHANGE2 ?

Regards

Uwe

Read only

0 Likes
1,527

Yes, the commit was performed after the successful execution of BAPI_DOCUMENT_CHANGE2 and the characteristicvalues table was populated. No data was updated.

If someone has successfully updated characteristicvalues via BAPI_DOCUMENT_CHANGE2, can you provide some example code ?

Edited by: RGSAP2008 on Oct 1, 2009 1:48 PM

Read only

0 Likes
1,527

Hello Trupti

I am not using the BAPI_DOCUMENT CHANGE2 but I am creating new DMS document using the BAPI_DOCUMENT_CERATE2 and it does the work.

Here is the code I am using. I hope that can help to compare with BAPI_DOCUMENT_CHANGE2.


****** Key fields of the document
  DATA: lf_doctype    LIKE bapi_doc_aux-doctype, " bapi_doc_draw2-documenttype,
        lf_docnumber  LIKE bapi_doc_aux-docnumber, " bapi_doc_draw2-documentnumber,
        lf_docpart    LIKE bapi_doc_aux-docpart, " bapi_doc_draw2-documenttype,
        lf_docversion LIKE bapi_doc_aux-docversion. " bapi_doc_draw2-documenttype.
******  Originals that are checked in simultaneously
  DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
        lt_drat  LIKE bapi_doc_drat   OCCURS 0 WITH HEADER LINE,   "   Short texts
        lt_drad  LIKE bapi_doc_drad   OCCURS 0 WITH HEADER LINE,   " Object links
        lt_charact LIKE bapi_characteristic_values OCCURS 0 WITH HEADER LINE.
***** Allcoate document data
  ls_doc-documenttype   = P_dokar.
  ls_doc-documentnumber = p_doknr.
  ls_doc-documentversion = '00'.
  ls_doc-documentpart = '000'.
  ls_doc-statusintern = 'FR'.   " Status Release
  ls_doc-statuslog = 'Your text'.
  ls_doc-wsapplication1 = 'ACR'.  " Adobe PDF file to upload
***** Check in original 1 simultaneously in the SAP Database
  REFRESH lt_files.
  CLEAR lt_files.
***** Short texts
  CLEAR lt_drat.
  REFRESH lt_drat.
***** English short text
  lt_drat-language = 'EN'.
  lt_drat-description = 'YOURDESCRIPTION'.
  APPEND lt_drat.
** Characteristics
  lt_charact-classtype = p_ctype. " Classifiaction - Class Type
  lt_charact-classname = p_cname. " Classification - Assignments Class
  lt_charact-charname  = p_name.  " Classification - Characteristic Description
  lt_charact-charvalue = p_value. " Classification - Characteristic value
  APPEND lt_charact.

** Create document
  CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
  EXPORTING: documentdata = ls_doc
  IMPORTING: documenttype = lf_doctype
                      documentnumber = lf_docnumber
                      documentpart = lf_docpart
                      documentversion = lf_docversion
                      return = return
  TABLES: documentdescriptions = lt_drat
                documentcharacteristicvalues = lt_charact.

If filling the characteristic table doresn't work, there are only possibilities.

1. The information pass to the table is not right

2. There is a bug into the BADI_DOCUMENT_CHANGE2

Regards

dstj