SAP Program REAARCH_ANALYSE_LINE - Analyze Billing Document for Archiving of Document Line Items

Title
Analyze billing document line items for archiving

Purpose
This report carries out the first step in archiving billingdocument line items with a view to possibly archiving them.
The archiving object related to the archiving of billing documents iscalled ISU_BILLZ. It includes the following data from the billingdocument:

  • Billing document line items (DBERCHZ)

  • Discount line item data for the billing document (DBERCHR)

  • Texts for a billing line item (DBERCHT)

  • Data on conversion steps per bill line item (DBERCHU)

  • Tax code information (DBERDTAX)

  • Using the Define Archiving Object transaction (AOBJ),you can find the definition of the ISU_BILLZ archiving object and therelated Customizing.
    Using the Archive Administration transaction(SARA), you can find archiving administration and the relatedCustomizing.
    Using the Archive Information System transaction (SARI), you can find the technical view of an archive.

    Integration

    • REAARCH_READ_LINES

    • Second step: Archive the billing document line items selected inthe first step.
      • REAARCH_DELETE_LINES

      • Third step: Delete the billing document line items in thedatabase, on the basis of the previously created archive.
        • REAARCH_RELOAD_LINES

        • Use this report to reload data that has been archived and alreadydeleted. Note that you cannot reload individual documents. You have toreload the entire archiving run. This procedure should not normally beused and should be limited to extreme problem cases (such as anincorrect retention period in Customizing).
          • REAARCH_READ_ARCHIVE_LINES

          • This report allows you to read a billing document line item archive, andto display parts of the data in a list before the deletion program hasbeen executed. It displays the data in a technical view.

            Features
            The analysis report selects the following billing documents:

            • Billing documents that lie within the specified document, contract
            • account, or contract range
              • Billing documents that do not have an archiving status in the ERCHARC
              • table
                • Billing documents that are not simulation documents, and whose retention
                • period has expired. The simulation documents are deleted.
                  The retention period (in days) is set inCustomizing.
                  • If GDPdU checks are activated in your system (see Customizing table
                  • TE026), the system checks the default implementation of BAdIISU_TO_BILL_GDPDU to determine whether thebilling document has already been extracted.
                    Additional checks may be necessary, depending on the document category:
                    • Standard documents:

                    • A standard document can be archived if it has been invoiced and theprint document has been archived.
                      • Reversal documents:

                      • A reversal document can be archived without undergoing any additionalchecks if it is not an adjustment document.
                        If it is an adjustment document, it can only be archived if the documentcontaining the adjustment is also archived.
                        • Manual documents:

                        • A manual document can be archived if it has been invoiced and the printdocument has already been archived.
                          • Backbilling documents:

                          • A backbilling doucment can only be archived in a complete billingperiod. For example if the billing period is twelve months, none of thebackbilling documents can be archived until the last document for thatperiod is ready for archiving.
                            The last document must have been invoiced, the print document must havebeen archived, and a billing document issued for the period after thedocument to be archived must exist.
                            • Backbilling documents(for n periods):

                            • A backbilling document for the current billing period cannot bearchived. Therefore, the n most recent documents are not includedfor archiving. After the n periods, the documents must beinvoiced, the print document must be archived, and a billing documentfor a period after that of the document to be archived must exist.
                              • Period-end billing documents:

                              • A period-end billing document can only be archived in a complete billingperiod. If the billing period is twelve months, none of the documentscan be archived until the last document for that period is ready forarchiving. The last document must have been invoiced, the print documentmust have been archived, and a billing document must exist for a periodafter that of the document to be archived.
                                • Period-end billing documents (if you performed a separate
                                • backbilling):
                                  The document must have been invoiced and the print document must havebeen archived.
                                  If a document cannot be archived, the system displays anerror message. You can then process the reason for the documentnot being archived:
                                  • No follow-on billing document

                                  • Billing document has not yet been invoiced

                                  • Print document has not yet been archived

                                  • Period-end billing document cannot be archived

                                  • Backbilling document cannot be archived

                                  • You can define your own additional checks using a user exit. Formore information, see the documentation on the ETOAR004enhancement (using the SAP Enhancement Managementtransaction - SMOD) and the EXIT_REAARCH_ANALYSE_LINES_001 functionmodule.
                                    You can use the ISU_TO_BILL_GDPDU BAdI todefine further checks for GDPdU.
                                    The archive status of all the billing documents that remain after theanalysis process is set to 1 (billing document line items canbe archived) in the ERCHARC table. If you start the analysis reportin test mode, the archiving indicator is not set.

                                    Starting the Program
                                    When you start the report you can make various settings on the initialscreen:

                                    • Document number: Limits the data to be analyzed to certain
                                    • billing document numbers
                                      • Contract account: Limits the data to be analyzed to certain
                                      • contract accounts
                                        • Contract: Limits the data to be analyzed to certain contracts

                                        • Log type: General statistical data, detail log with detailed data
                                        • for each analyzed record (can become confusing with large amounts ofdata) or detail log with detailed data for documents that could not bearchived.
                                          • Run time restriction: If you activate the run time restriction,
                                          • the analysis report terminates when the end date and end time isreached. This means that you can let the analysis report run as a jobduring short time frames.
                                            • Activate DPC analysis: If you select this field, billing
                                            • documents with the billing procedure dynamic period control arechecked. If you bill a lot of customers using this billing procedure, itcan improve the performance of the archiving report.
                                              • Test run: If you start the report as a test run, no changes are
                                              • made to the database (updating the archiving indicator in the billingdocument header).
                                                • Automatic archiving start: Setting this indicator triggers the
                                                • SAP_ISU_ARC_BIDOC_ANA_LINE_END event after the end of the analysis run.If you have previously scheduled an archiving run with the sameselection parameters and variant name, as well as the start conditionAfter Event, then this archiving run is started automaticallyafter the end of the analysis run.

                                                  Error Messages Specific to the Report (for System Administrators)
                                                  If one of the following system messages appears while the program isrunning, proceed as follows:

                                                  • Program stop: Error inserting the archiving indicator in the ERCHARC
                                                  • table
                                                    A list of billing document numbers is displayed with this error message.The line could not be inserted into one of these billing documents.
                                                    Determine which billing documents could not be inserted. Determine andcorrect the cause of this message. Restart the analysis report.
                                                    • Program stop: Error reading from a database table

                                                    • An unexpected error occurred when reading data from a table.
                                                      Correct the reason for the error message. Restart the archiving report.