Fonction SAP BCA_DIM_BILLDOC_CANCEL - Wrapper RFC for billing Document Cancel

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
I_READ_ARCHIVE BAPI_READ_ARCHIVE u 1 SPACE X Also Read Archived Documents
I_STR_REVERSAL_DOC BAPI_EXT_REVERSAL_DOC u 30 X External Reversal Billing Document
I_STR_REVERSED_DOC BCA_STR_DIM_EXT_REVERSED_DOC u 67 X External Billing Document to be Reversed
I_TESTRUN BAPI_AUX_INV-TESTRUN C 1 SPACE X Test Run

Paramètre Reférence Type Long. Description
E_NEW_REVERSALDOC BAPI_NEW_REVERSALDOC u 12 New Reversal Billing Document

Paramètre Reférence Long. Facultatif Description
E_TAB_EXTENSIONOUT BAPIPAREX 990 X Customer Enhancements
E_TAB_RETURN BAPIRET2 548 X Return Parameter
I_TAB_BILLDOC_REV BCA_TAB_DIM_BILLDOC_REV 97 X Reversal of bill documents for TRBK
I_TAB_EXTENSIONIN BAPIPAREX 990 X Customer Enhancements

Exception Description
CLEAR_ACCT_NOT_QUALIFIED Clearing Account Number not Qualified
FAILED Billing Document Cancel Failed
INPUT_NOT_QUALIFIED Input not qualified
INVOICE_REVERSAL_FAILED Invoice reversal failed

Functionality
With the function module BCA_DIM_BILLDOC_CANCEL, you can reverse abilling document in the Contract Account Receivable and Payable (FI-CAx)system. This reversal process is triggered by the Account Managementsystem (external billing system).
The reversal is stored in the FI-CAx system as a reversal billingdocument. The system ensures that both this document and the billingdocument to be reversed are not invoiced.
The import parameter I_STR_REVERSAL_DOC defines the properties of thereversal document.
The E_TAB_RETURN parameter can deliver several message numberssimultaneously. These messages are also stored in the application logunder object name FS_PROT (Financial Services - Standard Log), with thesubobject ERROR (Normal Error) and the External ID BILLDOC_CANCEL.
Billing Reversal
Depending on whether the billing document to be canceled is alreadyinvoiced or not, billing reversal takes place in the following twoscenarios:

  • Reversal of billing document not yet invoiced

  • The system creates a reversal document, which consists of only adocument header, but does not create any new invoicing orders.
    The sytem deletes the invoicing order of the billing document to bereversed. After deletion, the system cannot invoice reversed billingdocuments or reversal billing documents once again.
    • Reversal of billing document already invoiced

    • The system reverses the invoice document and creates a new reversalbilling document, which consists of a document header with documentitems. The system copies the document item values (amount and quantity)present in the reversed billing document and changes them to negativevalues in the new reversal billing document. Next, the system deletesthe invoicing order of the billing document. After deletion, the systemcannot invoice reversed billing documents or reversal billing documentsonce again.
      Note:
      • This function module carries out the following actions:

      • Perform direct updates in a successful case and does not use the updatetask
        Perform a COMMIT WORK for each call
        Not perform any separate authorization checks
        • With this function module, you cannot:

        • Reverse simulated billing documents
          Reverse billing documents that have already been reversed again
          Reverse reversal documents
          Reversal billing documents require a unique reference to a document inthe legacy system

          Description
          The component BILLDOCNO of this export parameter E_NEW_REVERSALDOCcontains the document number of the reversal document.

          Description
          This field controls access to the archived billing documents. Thiscauses that the billing document to be cancelled shall be looked inarchives also. The billing document which to be cancelled is lookedfor first on the data base. If the document is not found on the database and if this field is marked, then the billing document which has tobe cancelled is looked in archives also.
          Note: Accessing archived billing documents lead to long runningtime.

          Description
          The import parameter REVERSAL_DOC defines the properties of the reversaldocument:
          ,,The component REFDOCNO must contain the document number of thereversal document in the external system.
          ,,The component DOCTYPE_EXT is used to determine the document type ofthe reversal document using posting area 2645. If you leave thiscomponent empty, the document type of the document to be reversed iscopied.

          Description
          The import parameter I_STR_REVERSED_DOC identifies the billing documentthat is to be reversed.
          ,,The components LOG_SYSTEM and REFDOCNO must be filled. They identifythe billing document to be reversed from the view of the legacy system.
          ,,The component CLEAR_ACCT must contain the clearing account number ofthe document to be reversed.

          Description
          If this import parameter I_TESTRUN is selected, the BAPI does notperform any database changes. However, all checks are carried out. Anyerrors that occurred are written to the export table E_TAB_RETURN.

          Description
          With this export table E_TAB_EXTENSIONOUT, the BAPI can returnadditional data to the caller. The standard system delivered by SAP doesnot use the export table. If you want to fill the table, you have toimplement the methods of the BAdI INV_BILL_CANCEL.

          Description
          This export table E_TAB_RETURN contains all log messages. If the tablecontains one or more messages of message type E or A, an error hasoccurred that led to termination of processing.

          Description
          With this import table I_TAB_EXTENSIONIN customer can provide theBAPI with additional data. The SAP standard delivery ignores the table;it is merely forwarded to the methods of the BAdI INV_BILL_CANCEL.