Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> UserExit>AFAR0003



Index

AFAR0003

User Exit for Depreciation Calc.Key
Using this SAP enhancement, you can define the changeover method of a depreciation key yourself.

Activities

Carry out the activities below in order to use this individual changeover method for depreciation calculation:

  • Adapt function module EXIT_SAPLAFAR_003 to your specific requirements (see example).
  • Activate a customer project using the SAP standard enhancement AFAR0003 (Function Project management of SAP enhancements - Transaction: CMOD).

Parameters

Function module EXIT_SAPLAFAR_003 offers the following parameters for creating your own changeover method:

  • I_AFABE - depreciation area that is now being processed
  • I_ANLB - depreciation terms of this depreciation area
  • I_ANTS - partial structure of asset master record (ANLA)
  • I_T090 - calculation key

In addition, you can access local copies of the tables

  • T_ANEA - asset line items proportional values
  • T_ANEP - asset line items
  • T_ANLC - asset value fields
  • T_ANLZ - asset allocations with validity date

The expected return value is the changeover year (E_UMJAR) determined, and an indicator E_AKTIV = 'X'.

There is already an include to program ZXAFAU03 in this function module. You have to create this included program yourself, and provide the program code necessary for your own changeover method. You have to use the names used here, in order for all of the data transferred in the customer function module to be available.

Example
Below is a simple example for the implementation of function module EXIT_SAPLAFAR_003.


*---------------------------------------------------------------------*
* INCLUDE ZXAFAU03 *
*---------------------------------------------------------------------*
* Changeover at start of 5th year of useful life
CLEAR E_UMJAR.
E_AKTIV = 'X'.
LOOP AT T_ANLC WHERE AFABE = I_AFABE.

IF T_ANLC-NDABJ > '004' OR
( T_ANLC-NDABJ = '004' AND T_ANLC-NDABP > '000' ).
E_UMJAR = T_ANLC-GJAHR.
ENDIF.
* leave loop.

Function/Program:
  • EXIT_SAPLAFAR_003: Customer-Specific Changeover Method

02-Oct-2005