Fonction SAP BAPI_GRIRDOC_CANCEL - GR/IR Clearing Account: Reverse Account Maintenance Document

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
FISCAL_YEAR BAPI_INCINV_FLD-FISC_YEAR N 4 Fiscal Year of an Account Maintenance Document
GR_IR_ACCOUNT_DOC BAPI_GRIRDOC-GR_IR_ACCOUNT_DOC C 10 Document number of an account maintenance document
HEADER_TXT BAPI_INCINV_CREATE_HEADER-HEADER_TXT C 25 X Document Header Text
PSTNG_DATE BAPI_INCINV_CREATE_HEADER-PSTNG_DATE D 8 Posting Date in the Document
REF_DOC_NO BAPI_INCINV_CREATE_HEADER-REF_DOC_NO C 16 X Reference Document Number
TESTRUN BAPIFLAG-BAPIFLAG C 1 ' ' X Switch to Simulation Mode for Write BAPIs

Paramètre Reférence Type Long. Description
CANCEL_DOCUMENT BAPI_GRIRDOC u 14 GR/IR Clearing Account Return Structure

Paramètre Reférence Long. Facultatif Description
RETURN BAPIRET2 548 Return Messages

Functionality
You can use this method to reverse a posted account maintenancedocument, thereby restoring the original difference on the GR/IRclearing account.
You must transfer the key fields (fiscal year and document number) ofthe account maintenance document that you want to reverse, together withthe posting date, as import parameters for the method. In addition, youcan enter a reference document number and a document header text.
The document number and document year of the reversal document arereturned in export parameter CANCEL_DOCUMENT.
Return messages
Messages are returned in the Return parameter. The return valuesand their meanings are described in the documentation for thisparameter.

Description
After a reversal document has been posted successfully, this exportparameter returns the document number of the reversal document (fieldGR_IR_ACCOUNT_DOC) and the fiscal year (field FISC_YEAR).
INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX LANGUAGE EN

Description
This import parameter contains the fiscal year of the accountmaintenance document for which you want to post a reversal document.
For information about the meaning of the fiscal year, see the dataelement documentation: Fiscal Year.

Description
This import parameter contains the document number of the accountmaintenance document for which you want to post a reversal document.
For information on the meaning of the account maintenance document, seethe data element documentation: Document Number of anAccount Maintenance Document.

Description
If a document header text is entered, this is saved in the reversaldocument for the account maintenance document.
For information about the meaning of the document header text, see thedata element documentation:Document Header Text.

Description
For information about the posting date, see the data elementdocumentation: Posting Date in the Document.

Description
If the reference document number is entered, this is saved in thereversal document for the account maintenance document.
For information about the meaning of the reference document number, seethe data element documentation: Reference Document Number
.

Description
This parameter specifies whether the reversal of an account maintenancedocument is to run in simulation mode at first. If this indicator isset, the reversal of the account maintenance document is only simulated,which means that the data of the reversal document is not written to thedatabase.

Value range
Blank = Document is saved.
x = Document is not saved.

Default
Blank

Description
INCLUDE BAPI_TABLE OBJECT DOKU ID TX

Value range
Type,, ID,, Number,, Message,,
E,, M8,, 022,, Allowed posting periods: &
E,, M8,, 351,, Document already reversed with document &1 (fiscal year2)
Messages from other function modules or programs may also appear.