BAPI_CTRACDOCUMENT_WRITEOFF 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_WRITEOFF into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
FKK_BOR_DOC
Released Date:
11.09.2002
Processing type: Remote-Enabled
CALL FUNCTION 'BAPI_CTRACDOCUMENT_WRITEOFF' "BAPI: Write Off FI-CA Document
EXPORTING
documentnumber = " bapidfkkko-doc_no Number of a Contract Accounts Receivable and Payable Document
* posting_date = " bapirfka1-post_date Posting Date in the Document
* currency = " bapirfka1-currency Currency Key
* doc_type = " bapirfka1-doc_type Document Type
* fikey = " bapirfka1-fikey Reconciliation Key for General Ledger
charge_off_reason = " bapidfkkko-charge_off_reason Write-Off Reason
* no_checks = SPACE " bapirfka1-no_checks Write-Off without Check Rules
* transfer_to_coll = SPACE " bapirfka1-transfer_to_coll Submission to Collection Agency
* application_fields = " bapirfka1 BAPI: Application Fields for Write-Off
* created_by = " bapidfkkko-created_by Name of Person Who Created Object
IMPORTING
return = " bapiret2 Return Parameters
ret_documentnumber = " bapidfkkko-doc_no Number of a Contract Accounts Receivable and Payable Document
* TABLES
* openitems = " bapidfkkcl Clearing Items for Document in Contract A/R + A/P
* extensionin = " bapiparex Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
. " BAPI_CTRACDOCUMENT_WRITEOFF
The ABAP code below is a full code listing to execute function module BAPI_CTRACDOCUMENT_WRITEOFF 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_return | TYPE BAPIRET2 , |
| ld_ret_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| it_openitems | TYPE STANDARD TABLE OF BAPIDFKKCL,"TABLES PARAM |
| wa_openitems | LIKE LINE OF it_openitems , |
| it_extensionin | TYPE STANDARD TABLE OF BAPIPAREX,"TABLES PARAM |
| wa_extensionin | LIKE LINE OF it_extensionin . |
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_return | TYPE BAPIRET2 , |
| ld_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| it_openitems | TYPE STANDARD TABLE OF BAPIDFKKCL , |
| wa_openitems | LIKE LINE OF it_openitems, |
| ld_ret_documentnumber | TYPE BAPIDFKKKO-DOC_NO , |
| ld_posting_date | TYPE BAPIRFKA1-POST_DATE , |
| it_extensionin | TYPE STANDARD TABLE OF BAPIPAREX , |
| wa_extensionin | LIKE LINE OF it_extensionin, |
| ld_currency | TYPE BAPIRFKA1-CURRENCY , |
| ld_doc_type | TYPE BAPIRFKA1-DOC_TYPE , |
| ld_fikey | TYPE BAPIRFKA1-FIKEY , |
| ld_charge_off_reason | TYPE BAPIDFKKKO-CHARGE_OFF_REASON , |
| ld_no_checks | TYPE BAPIRFKA1-NO_CHECKS , |
| ld_transfer_to_coll | TYPE BAPIRFKA1-TRANSFER_TO_COLL , |
| ld_application_fields | TYPE BAPIRFKA1 , |
| ld_created_by | TYPE BAPIDFKKKO-CREATED_BY . |
You can use this BAPI to write off an FI-CA document (see transction
FP04).
...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_WRITEOFF or its description.
BAPI_CTRACDOCUMENT_WRITEOFF - BAPI: Write Off FI-CA Document BAPI_CTRACDOCUMENT_TRANSFER - BAPI: Transfer of Open FI-CA Items BAPI_CTRACDOCUMENT_REVERSECLR - BAPI: FI-CA - Reset Document Clearing 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