SAP Function Modules

BAPI_CTRACDOCUMENT_REVERSE SAP Function module - BAPI: FI-CA - Reverse Document







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
remote enabled module settings


Pattern for FM BAPI_CTRACDOCUMENT_REVERSE - BAPI CTRACDOCUMENT REVERSE





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

ABAP code example for Function Module 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).

DATA:
ld_rev_documentnumber  TYPE BAPIDFKKKO-DOC_NO ,
ld_return  TYPE BAPIRET2 .


DATA(ld_documentnumber) = some text here

DATA(ld_post_date) = 20210129

DATA(ld_doc_type) = some text here

DATA(ld_clear_reas) = some text here

DATA(ld_return_reason) = some text here

DATA(ld_fikey) = some text here

DATA(ld_doc_source_key) = some text here

DATA(ld_reverse_date) = 20210129

DATA(ld_all_repetitions) = some text here

DATA(ld_testrun) = some text here
DATA(ld_reckeyinfo) = 'Check type of data required'.

DATA(ld_reversemethode) = some text here

DATA(ld_checkarchive) = some text here

DATA(ld_caller_id) = some text here

DATA(ld_checkvoidingreason) = some text here

DATA(ld_transferpost) = some text here . CALL FUNCTION 'BAPI_CTRACDOCUMENT_REVERSE' EXPORTING documentnumber = ld_documentnumber * post_date = ld_post_date doc_type = ld_doc_type clear_reas = ld_clear_reas * return_reason = ld_return_reason * fikey = ld_fikey doc_source_key = ld_doc_source_key * reverse_date = ld_reverse_date * all_repetitions = ld_all_repetitions * testrun = ld_testrun * reckeyinfo = ld_reckeyinfo * reversemethode = ld_reversemethode * checkarchive = ld_checkarchive * caller_id = ld_caller_id * checkvoidingreason = ld_checkvoidingreason * transferpost = ld_transferpost IMPORTING rev_documentnumber = ld_rev_documentnumber return = ld_return . " BAPI_CTRACDOCUMENT_REVERSE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

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 .


ld_documentnumber = some text here

ld_post_date = 20210129

ld_doc_type = some text here

ld_clear_reas = some text here

ld_return_reason = some text here

ld_fikey = some text here

ld_doc_source_key = some text here

ld_reverse_date = 20210129

ld_all_repetitions = some text here

ld_testrun = some text here
ld_reckeyinfo = 'Check type of data required'.

ld_reversemethode = some text here

ld_checkarchive = some text here

ld_caller_id = some text here

ld_checkvoidingreason = some text here

ld_transferpost = some text here

SAP Documentation for FM BAPI_CTRACDOCUMENT_REVERSE


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








Contribute (Add Comments)

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.