Fonction SAP BAPI_DOCUMENT_DEQUEUE - Unlock Document

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DOCUMENTNUMBER BAPI_DOC_AUX-DOCNUMBER C 25 Document Number
DOCUMENTPART BAPI_DOC_AUX-DOCPART C 3 Document Parts
DOCUMENTTYPE BAPI_DOC_AUX-DOCTYPE C 3 Document Type
DOCUMENTVERSION BAPI_DOC_AUX-DOCVERSION C 2 Document Version

Paramètre Reférence Type Long. Description
RETURN BAPIRET2 u 548 BAPI Return

Functionality
You can use this method to remove a change lock.

Notes
The system only removes a change lock that was set by BAPIBAPI_DOCUMENT_ENQUEUE. Locks that were set by transactions are notremoved.

Example
Example program
*************
**Define variables required
************
* Document data (number, version, change number, and so on)
* that uniquely identifies the object
DATA: lt_doc LIKE bapi_doc_aux,
* BAPI return structure
ls_return LIKE bapiret2.
*******************************************
** Assign document data
** Unlock document
******************************************
lt_doc-doctype = 'DRW' .
lt_doc-docnumber = 'DOKUMENTNUMMER' .
lt_doc-docversion = '00' .
lt_doc-docpart = '000' .
********************************************************************

** Call the BAPI that makes the document changeable again
********************************************************************

CALL FUNCTION 'BAPI_DOCUMENT_DEQUEUE'
EXPORTING: documenttype = lt_doc-doctype
documentnumber = lt_doc-docnumber
documentpart = lt_doc-docpart
documentversion = lt_doc-docversion
IMPORTING: return = ls_return.
** Any errors?
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.