SAP ANEP_AFARECHNEN Function Module for









ANEP_AFARECHNEN is a standard anep afarechnen SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for anep afarechnen FM, simply by entering the name ANEP_AFARECHNEN into the relevant SAP transaction such as SE37 or SE38.

Function Group: AFAR
Program Name: SAPLAFAR
Main Program: SAPLAFAR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ANEP_AFARECHNEN pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'ANEP_AFARECHNEN'"
EXPORTING
I_ANTS = "Field string of DDIC structure ANTS
* I_DATBIS = '00000000' "is no longer used
* I_FEHLER = ' ' "Suppress error output (x)
* I_PERBIS = ' ' "Depreciation invoice up to this period
* I_TRACE = ' ' "Depreciation trace switch
* I_NACHAKT = ' ' "Post-capitalization
* I_CAL_CLOSED_FYEARS = ' ' "Recalculate closed fiscal years

IMPORTING
E_KAFABE = "Depreciation area showing reduction

TABLES
T_ANEA = "Table of proportional values
T_ANEP = "Table of line items
T_ANFM = "Error table
T_ANLB = "Table of company-code-dependent values for an asset
T_ANLC = "Table of year-related values of an asset
T_ANLZ = "G/L account number

EXCEPTIONS
DEPR_NOT_POSIBLE = 1 MAN_AUTO_AFA = 2 MINWERT_VERLETZT = 3 NORMAL_AFA_VERLETZT = 4 PERIOD_FALSE = 5 RBW_VIRT_AFABER_VERLETZT = 6 SONDER_AFA_VERLETZT = 7 ANSWPRUEF_VERLETZT = 8
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLAFAR_001 Allows Modification of Base Value for Depreciation Calculation
EXIT_SAPLAFAR_002 Customer-Specific Calculation of Depreciation on Transaction
EXIT_SAPLAFAR_003 Customer-Specific Changeover Method
EXIT_SAPLAFAR_004 Customer-Specific Determination of Proportional Values at Retirement

IMPORTING Parameters details for ANEP_AFARECHNEN

I_ANTS - Field string of DDIC structure ANTS

Data type: ANTS
Optional: No
Call by Reference: No ( called with pass by value option)

I_DATBIS - is no longer used

Data type: ANEP-BZDAT
Default: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FEHLER - Suppress error output (x)

Data type: ANLB-XNEGA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PERBIS - Depreciation invoice up to this period

Data type: ANEP-PERAF
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TRACE - Depreciation trace switch

Data type: ANLB-XNEGA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_NACHAKT - Post-capitalization

Data type: ANLB-XNEGA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_CAL_CLOSED_FYEARS - Recalculate closed fiscal years

Data type: ANLB-XNEGA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for ANEP_AFARECHNEN

E_KAFABE - Depreciation area showing reduction

Data type: ANLB-AFABE
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for ANEP_AFARECHNEN

T_ANEA - Table of proportional values

Data type: ANEA
Optional: No
Call by Reference: No ( called with pass by value option)

T_ANEP - Table of line items

Data type: ANEP
Optional: No
Call by Reference: No ( called with pass by value option)

T_ANFM - Error table

Data type: ANFM
Optional: No
Call by Reference: No ( called with pass by value option)

T_ANLB - Table of company-code-dependent values for an asset

Data type: ANLB
Optional: No
Call by Reference: No ( called with pass by value option)

T_ANLC - Table of year-related values of an asset

Data type: ANLC
Optional: No
Call by Reference: No ( called with pass by value option)

T_ANLZ - G/L account number

Data type: ANLZ
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

DEPR_NOT_POSIBLE - No depreciation calculation due to table inconsistency

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MAN_AUTO_AFA - Manual and automatic depreciation not allowed

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MINWERT_VERLETZT - Line item violates minimum value rule

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NORMAL_AFA_VERLETZT - Positive/negative sign rule for ord. depreciation is violated.

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PERIOD_FALSE - Period determination is incorrect

Data type:
Optional: No
Call by Reference: Yes

RBW_VIRT_AFABER_VERLETZT - Remaining book value rule is violated in derived deprec. area

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SONDER_AFA_VERLETZT - Positive/negative sign rule for spec.depreciation is violated.

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ANSWPRUEF_VERLETZT -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for ANEP_AFARECHNEN Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_i_ants  TYPE ANTS, "   
lt_t_anea  TYPE STANDARD TABLE OF ANEA, "   
lv_e_kafabe  TYPE ANLB-AFABE, "   
lv_depr_not_posible  TYPE ANLB, "   
lt_t_anep  TYPE STANDARD TABLE OF ANEP, "   
lv_i_datbis  TYPE ANEP-BZDAT, "   '00000000'
lv_man_auto_afa  TYPE ANEP, "   
lt_t_anfm  TYPE STANDARD TABLE OF ANFM, "   
lv_i_fehler  TYPE ANLB-XNEGA, "   SPACE
lv_minwert_verletzt  TYPE ANLB, "   
lt_t_anlb  TYPE STANDARD TABLE OF ANLB, "   
lv_i_perbis  TYPE ANEP-PERAF, "   SPACE
lv_normal_afa_verletzt  TYPE ANEP, "   
lt_t_anlc  TYPE STANDARD TABLE OF ANLC, "   
lv_i_trace  TYPE ANLB-XNEGA, "   SPACE
lv_period_false  TYPE ANLB, "   
lt_t_anlz  TYPE STANDARD TABLE OF ANLZ, "   
lv_i_nachakt  TYPE ANLB-XNEGA, "   SPACE
lv_rbw_virt_afaber_verletzt  TYPE ANLB, "   
lv_i_cal_closed_fyears  TYPE ANLB-XNEGA, "   SPACE
lv_sonder_afa_verletzt  TYPE ANLB, "   
lv_answpruef_verletzt  TYPE ANLB. "   

  CALL FUNCTION 'ANEP_AFARECHNEN'  "
    EXPORTING
         I_ANTS = lv_i_ants
         I_DATBIS = lv_i_datbis
         I_FEHLER = lv_i_fehler
         I_PERBIS = lv_i_perbis
         I_TRACE = lv_i_trace
         I_NACHAKT = lv_i_nachakt
         I_CAL_CLOSED_FYEARS = lv_i_cal_closed_fyears
    IMPORTING
         E_KAFABE = lv_e_kafabe
    TABLES
         T_ANEA = lt_t_anea
         T_ANEP = lt_t_anep
         T_ANFM = lt_t_anfm
         T_ANLB = lt_t_anlb
         T_ANLC = lt_t_anlc
         T_ANLZ = lt_t_anlz
    EXCEPTIONS
        DEPR_NOT_POSIBLE = 1
        MAN_AUTO_AFA = 2
        MINWERT_VERLETZT = 3
        NORMAL_AFA_VERLETZT = 4
        PERIOD_FALSE = 5
        RBW_VIRT_AFABER_VERLETZT = 6
        SONDER_AFA_VERLETZT = 7
        ANSWPRUEF_VERLETZT = 8
. " ANEP_AFARECHNEN




ABAP code using 7.40 inline data declarations to call FM ANEP_AFARECHNEN

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
"SELECT single AFABE FROM ANLB INTO @DATA(ld_e_kafabe).
 
 
 
"SELECT single BZDAT FROM ANEP INTO @DATA(ld_i_datbis).
DATA(ld_i_datbis) = '00000000'.
 
 
 
"SELECT single XNEGA FROM ANLB INTO @DATA(ld_i_fehler).
DATA(ld_i_fehler) = ' '.
 
 
 
"SELECT single PERAF FROM ANEP INTO @DATA(ld_i_perbis).
DATA(ld_i_perbis) = ' '.
 
 
 
"SELECT single XNEGA FROM ANLB INTO @DATA(ld_i_trace).
DATA(ld_i_trace) = ' '.
 
 
 
"SELECT single XNEGA FROM ANLB INTO @DATA(ld_i_nachakt).
DATA(ld_i_nachakt) = ' '.
 
 
"SELECT single XNEGA FROM ANLB INTO @DATA(ld_i_cal_closed_fyears).
DATA(ld_i_cal_closed_fyears) = ' '.
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!