SAP Program RASPEC01 - Redestribution of special assets

Purpose
This program allows write-up or write-down postings to assets (whichbelong to a special asset) and to special assets. A user exit (function'REDISTRIBUTE_DEPRECIATION') provides the ability to calculate theposting amounts according to customer needs.
The program passes the following tables to the user exit:
T_ANL
T_SPEC
T_SPEC_CUM
Additional asset data (such as ANLB fields) can be selected from withinthe user exit.
If the program is run without the 'Test' option a BDC session iscreated. The BDC session will contain all write-up/write-down documentsand can be processed to create the actual postings.
T_ANL
This table lists all information for the individual assets which belongto a special asset. In particular, this table contains all ANLA, ANLZand ANLC fields. In addition, for each individual asset thecorresponding special asset number is stored in fields ANLN1_ABG andANLN2_ABG.
Especially important are the following fields:
NAFAG_ABG - ordinary depreciation
SAFAG_ABG - special depreciation
AAFAG_ABG - unplanned depreciation
MAFAG_ABG - transfer of reserves
These fields can be assigned values for the write-up/write-downpostings within the user exit. The user exit will then pass the tablesback to the calling program where the amounts are read. If theseamounts are positive the program will use the write-up transactiontype. If these amounts are negative the program will use the write-downtransaction type respectively. If the amounts are zero for a particularasset no posting is created for this asset.
T_SPEC_CUM
This table has nearly the same structure as T_ANL, but only containsthe special assets' main- and sub-number as well as the accumulatedANLC values for its individual assets. This table is used only toassist the calculations within the user exit. The contents of thistable should not be modified as the main program would ignore thisinformation.

Prerequisites
This program assumes that the customer is using the special assetsfunctionality within the FI-AA system (either via direct assignments orvia substitution and/or user exit).
Also, the transaction types used must be configured correctly so thatpostings are made to the corresponding depreciation area.

Output
If the 'List Assets' option is selected in the selection screen of theprogram, a report with the following detail is output:

  • special asset main- and sub-number

  • individual asset main- and sub-number

  • individual asset description

  • write-up/write-down amounts for:

  • ordinary depreciation
    special depreciation
    unplanned depreciation
    transfer of reserves

    Example
    FUNCTION REDISTRIBUTE_DEPRECIATION
    *"----------------------------------------------------------------------
    *"*"Local interface:
    *" IMPORTING
    *" VALUE(P_AFABE) LIKE ANLC-AFABE
    *" VALUE(P_GJAHR) LIKE ANLC-GJAHR
    *" TABLES
    *" T_ANL STRUCTURE RASPEC OPTIONAL
    *" T_SPEC_CUM STRUCTURE RASPEC OPTIONAL
    *" EXCEPTIONS
    *" ERROR
    *"----------------------------------------------------------------------
    DATA: LD_TOTAL LIKE ANLC-KANSW,
    LD_AMOUNT LIKE ANLC-KANSW,
    LD_SUMME LIKE ANLC-KANSW.
    CONSTANTS: CON_X VALUE 'X'.
    LOOP AT T_SPEC_CUM.
    CLEAR LD_SUMME. CLEAR LD_TOTAL.
    LD_TOTAL = T_SPEC_CUM-GJE_KUMAFA.
    LOOP AT T_ANL WHERE
    ANLN1_ABG = T_SPEC_CUM-ANLN1 AND
    ANLN2_ABG = T_SPEC_CUM-ANLN2 AND
    SPECIAL_ASSET <> CON_X.
    LD_SUMME = LD_SUMME + T_ANL-GJE_KANSW.
    ENDLOOP.
    LOOP AT T_ANL.
    LD_AMOUNT = ( T_ANL-GJE_KANSW / LD_SUMME ) *
    LD_TOTAL.
    MOVE LD_AMOUNT TO T_ANL-NAFAV_ABG.
    MODIFY T_ANL.
    CLEAR LD_AMOUNT.
    ENDLOOP.
    ENDLOOP.
    ENDFUNCTION.