BAPI_CTRACDOCUMENT_REVERSE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name BAPI_CTRACDOCUMENT_REVERSE into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
FKK_BOR_DOC
Released Date:
05.08.1999
Processing type: Remote-Enabled
CALL FUNCTION 'BAPI_CTRACDOCUMENT_REVERSE' "BAPI: FI-CA - Reverse Document
EXPORTING
documentnumber = " bapidfkkko-doc_no Document number to be canceled
* post_date = " bapidfkkko-post_date Posting date of items to be reversed
doc_type = " bapidfkkko-doc_type Reversal document type
clear_reas = " bapidfkkop-clear_reas Clearing Reason
* return_reason = SPACE " bapidfkkko-return_reason Return reason
* fikey = " bapidfkkko-fikey Reversal document reconciliation key
doc_source_key = " bapidfkkko-doc_source_key Reversal document origin key
* reverse_date = " bapidfkkko-post_date Reversal date, if required
* all_repetitions = SPACE " bapictracaux-all_repet All open repetitions (stat. docs)
* testrun = SPACE " bapictracaux-testrun Simulate Only
* reckeyinfo = " bapireckeyinfo Information for Reconciliation Key
* reversemethode = SPACE " bapictracaux-reversemethode Reversal Method
* checkarchive = SPACE " bapictracaux-checkarchive Also Consider Document Archive
* caller_id = " fkkfields-callr Identification of Caller of Function Module
* checkvoidingreason = " bapictracaux-checkvoidingreason 1118687 Reason for Voiding a Check
* transferpost = " rfkb0-xstkl Transfer Post to Clarification Account
IMPORTING
rev_documentnumber = " bapidfkkko-doc_no Reverse document number
return = " bapiret2 Confirmations
. " BAPI_CTRACDOCUMENT_REVERSE
The ABAP code below is a full code listing to execute function module BAPI_CTRACDOCUMENT_REVERSE including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
| ld_rev_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| ld_return | TYPE BAPIRET2 . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_rev_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| ld_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| ld_return | TYPE BAPIRET2 , |
| ld_post_date | TYPE BAPIDFKKKO-POST_DATE , |
| ld_doc_type | TYPE BAPIDFKKKO-DOC_TYPE , |
| ld_clear_reas | TYPE BAPIDFKKOP-CLEAR_REAS , |
| ld_return_reason | TYPE BAPIDFKKKO-RETURN_REASON , |
| ld_fikey | TYPE BAPIDFKKKO-FIKEY , |
| ld_doc_source_key | TYPE BAPIDFKKKO-DOC_SOURCE_KEY , |
| ld_reverse_date | TYPE BAPIDFKKKO-POST_DATE , |
| ld_all_repetitions | TYPE BAPICTRACAUX-ALL_REPET , |
| ld_testrun | TYPE BAPICTRACAUX-TESTRUN , |
| ld_reckeyinfo | TYPE BAPIRECKEYINFO , |
| ld_reversemethode | TYPE BAPICTRACAUX-REVERSEMETHODE , |
| ld_checkarchive | TYPE BAPICTRACAUX-CHECKARCHIVE , |
| ld_caller_id | TYPE FKKFIELDS-CALLR , |
| ld_checkvoidingreason | TYPE BAPICTRACAUX-CHECKVOIDINGREASON , |
| ld_transferpost | TYPE RFKB0-XSTKL . |
You can use this method to cancel a document. The number of the
reversal document is returned in the REV_DOCUMENTNUMBER parameter.
...See here for full SAP fm documentation
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_CTRACDOCUMENT_REVERSE or its description.
BAPI_CTRACDOCUMENT_REVERSE - BAPI: FI-CA - Reverse Document BAPI_CTRACDOCUMENT_GETLIST - BAPI: FI-CA List of Documents BAPI_CTRACDOCUMENT_GETDETAIL - BAPI: FI-CA Read Document Detail Data BAPI_CTRACDOCUMENT_EXISTCHECK - BAPI: FI-CA Check Document Existence BAPI_CTRACDOCUMENT_CREATE - BAPI: Post FI-CA Document BAPI_CTRACDOCUMENT_CHANGE - BAPI: FI-CA Change Document