Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>SpecialPurposeLedger




The business object additional ledger is a ledger for freely definable evaluation and reporting purposes.

An additional ledger records values and quantities at company code or company level.



Available Methods

  • GetTotalRecords : Special Purpose Ledger: Select totals records for accounts [ BAPI_SL_GETTOTALRECORDS ]




With this method you can call up totals records for the Special Purpose Ledger.The following entries are mandatory: ledger, fiscal year, as well asthe company code for local ledgers and the global company for globalledgers. Additional selection criteria include the record type, version, account number, business area, cost center, profit center,
functional area, controlling area, currency key, period, and indicatorPERIOD_AGG, which produces a total for all periods selected. All fieldshave the following restriction: Data selection can only be carried outif the technical fields names match the SAP standard names (for example, account number = RACCT).

The totals records are output to table TOTALS_SPL. Customer-defined fields are not considered.

  • Customer fields:
  • For this reason, SAP enhancement GSL1021A was created.

  • Data selection with customer fields:
  • Using table ExtensionIn, you can include customer fields in your input
    parameters. We reccommend you use table ExtensionIn, if you want tocall up totals records from ZZ* or YY* summary tables, which youexplicitly select with customer fields. You enter parameters in theparameter ExtensionIn. When doing so, you have to transfer a row that
    has the value "BAPI_TE_SPL_PARAMETER" to the field STRUCTURE. Entervalues for all fields as parameters in the field VALUEPART1, entering the individual values without hyphens.
  • Note on data selection with customer fields:

  • Enter customer include CI_1021_INCLUDE_IN1 in your system in the structure BAPI_TE_SPL_PARAMETER with the desired fields.

  • Data output for customer fields:
  • The values for customer fields can be output using table EXTENSIONOUT.

  • Note on data output for customer fields:
  • To do this, enter include ZXSPLU01 in user-exit EXIT_SAPL1021_001 andassign the customer fields from the work area TOTALS_LINE (structure GLU1).

    Also, customer include CI_1021_INCLUDE_SUMTABLE_ZZ has to be created in your system with the desired output fields in structure
    BAPI_TE_SPL_SUMMARY_RECORD. Finally, a project for enhancement GSL1021Aneeds to be created with transaction CMOD and then activated. The output is in table form with the structure BAPIPAREX.


    You created table group ZZCUS and ledger Z1 for summary table ZZCUST.
    For each selected data record, the value for the account number (field RACCT) for example, is output in table TOTALS_SPL.

  • Selection with customer fields:
  • 1. Create include CI_1021_INCLUDE_IN1 for the structure BAPI_TE_SPL_PARAMETER. For the selection using field ZZFIELD2, assign
    it to include CI_1021_INCLUDE_IN1 and activate it.

    2. Make an entry in the first row of table EXTENSIONIN.


    VALUEPART1: 00010002 (0001: for row 1 (required), 0002: value for ZZFIELD2)

  • Output of customer fields:
  • To output the value of field ZZFIELD (data element ZZDE) in table EXTENSIONOUT for example, proceed as follows:

    1. For the structure BAPI_TE_SPL_SUMMARY_RECORD create includeCI_1021_INCLUDE_SUMTABLE_ZZ and assign field ZZFIELD with data element ZZDE as a component and activate the include.

    2. Create customer include ZXSPLU01 for function module EXIT_SAPL1021_001. Assign the related value to fieldCUSTOMER_ZZ-ZZFIELD from the work area TOTALS_LINE (TOTALS_LINE contains the structure GLU1):

    Move-corresponding totals_line to customer_zz.

    Now, activate the include.

    3. Create a project with transaction CMOD and assign the enhancement GSL1021A. Activate the project.

    You obtain the following result for table EXTENSIONOUT:


    VALUEPART1 2 0001

    Value 2 for VALUPART1 numerates the data record and allows anassignment to the related data record of table TOTALS_SPL. The value 0001 represent the result here for field ZZFIELD.