SAP Program SAMPLE_CREATE_BILLDOC - Generate Settlement Documents

Purpose
This is a sample report and is intended as a template for a customersolution. The report cancels processing before billing documents arereversed.
Important:
You must never run a report that reverses billing documents for testpurposes in a live system because it generates posting-relevantdocuments in the contract accounts receivable and payable (FI-CA)!
If you copy data from external systems, billing documents are generated.See the documentation about the function module
BAPI_BILLDOC_CREATEMULTIPLE. Invoicing posts billing documents incontract accounts receivable and payble and in FI-CA.
In the following example, it may make sense to generate billingdocuments using your own report:

  • You want to test invoicing for contract accounts receivable and payable
  • in a test system
    • It is not possible to use the above BAPI to copy external data into the
    • test system
      You can use this report as a template for your own solution. Copy thereport and delete the coding that causes processing to be canceled.Adjust the report to meet your requirements. The report uses thefunction module INV_SAMPLE_EXTERN_BILLDOCS to simulate external data,from which it generates test billing documents usíng the functionmodule BAPI_BILLDOC_CREATEMULTIPLE. If required, you can make additionsto the 'external' data of the function moduleINV_SAMPLE_EXTERN_BILLDOCS. You can also use your own function modulerather than INV_SAMPLE_EXTERN_BILLDOCS.

      Integration

      Prerequisites
      It is only possible for the INV_SAMPLE_EXTERN_BILLDOCS function moduleto simulate external data if you maintained the posting areas forcopying billing documents.
      The posting areas 2640, 2641, 2642 and 2642 must contain entries for the
      logical system, which is to be entered as a parameterwhen you run the report. If you maintain the posting areas for anotherlogical system, you must specify it when you run the report.
      Posting area 2640 must contain entries for the posting area, which is tobe entered as a parameter when you run the report..

      Selection
      Contract account: You can generate billing documents for one or morecontract account(s).
      Posting area: The report only processes contract accounts whoseposting area group is compatible with the predefinedposting area.
      Number of posting-relevant items: Defines how many posting-relevantitems are generated for each billing document
      Number of info items: Defines how many items not relevant for postingare to be generated for a billing document
      Add to simulated items: Causes the billing document to include items forwhich the dcocument item is simulatedindicator is set.
      Additional items: Causes the system to generate additional items(FKKIVBILL_A) table for every billing document.