Ansicht
Dokumentation

BAPI_DOCUMENT_CHANGE - Change Document

BAPI_DOCUMENT_CHANGE - Change Document

ROGBILLS - Synchronize billing plans   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module is obsolete. Use Bapi_Document_Change2 instead.

You can use this method to change documents.

You can also check the original application files (1 and 2) into the SAP database, vault, or archive at the same time.

Constraints:

Additional files are not supported

Long texts for object links are not supported

Value assignments for the object links are not supported

Mass check-ins are not supported

Example


**..... Document data
DATA: ls_doc LIKE bapi_doc_draw.

**..... Indicator for relevancy to change
ls_docx LIKE bapi_doc_drawx,

**..... Bapi return structure
ls_return LIKE bapiret2.

**.... Originals that are checked in at the same time
DATA: lt_files LIKE bapi_doc_files OCCURS 0 WITH HEADER LINE,

**.... Short Texts
lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,

**.... Object links
lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
**----------------------------------------------------------------------

** Allocate document data
ls_doc-documenttype = 'DRW'.
ls_doc-documentnumber = '4711'.
ls_doc-documentversion = '000'.
ls_doc-documentpart = '00'.

ls_doc-description = 'Gear box'.
ls_doc-laboratory = ''.

** Set indicator for relevancy to change
ls_docx-description = 'X'.
ls_docX-laboratory = 'X'.

** Add/create object link
CLEAR lt_drad.
REFRESH lt_drad.
lt_drad-objecttype = 'MARA'.
lt_drad-objectkey = 'M0815'.
APPEND lt_drad.
**----------------------------------------------------------------------
** Change document
**----------------------------------------------------------------------
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE'
EXPORTING: documenttype = ls_doc-documenttype
documentnumber = ls_doc-documentnumber
documentpart = ls_doc-documentpart
documentversion = ls_doc-documentversion
documentdata = ls_doc
documentdatax = ls_docx
IMPORTING: return = ls_return
TABLES: objectlinks = lt_drad.

** Error occurred ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.

ELSE.
COMMIT WORK.
ENDIF.

Notes

Apart from the document data, the following data can be changed:

  • Object links
    If you have integrated the SAP 3D Visual Enterprise Viewer, you can use this BAPI to create object links to task lists and maintenance orders so that you can display spare parts as 2D images and 3D scenes as well as play visual instructions. For more information, see the documentation for the parameter OBJECTLINKS.
  • Classifications and characteristic value assignments
  • Language-dependent document descriptions
  • Document long texts
  • Document structures
  • Originals (1 and 2)




Parameters

CHARACTERISTICVALUES
CLASSALLOCATIONS
DOCUMENTDATA
DOCUMENTDATAX
DOCUMENTDESCRIPTIONS
DOCUMENTFILES
DOCUMENTNUMBER
DOCUMENTPART
DOCUMENTSTRUCTURE
DOCUMENTTYPE
DOCUMENTVERSION
HOSTNAME
LONGTEXTS
OBJECTLINKS
RETURN

Exceptions

Function Group

CVBAPI

General Material Data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 4979 Date: 20240523 Time: 095900     sap01-206 ( 43 ms )