Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Change Base value for Asset Depreciation in ESS6.0.

Former Member
0 Kudos

Dear All

Before ESS6.0 to change Base value for Asset Depreciation we used user exit EXIT_SAPLAFAR_001.

Which method of which BADI should we used to do the same in ESS6.0.

I tried FAA_EE_CUSTOMER-> SET_BASE_VALUE but have not found in the impost parameters information required for re-calculation: Company code, Asset ID, Asset class and others.

Thanks a lot.

Svetlana

3 REPLIES 3

Former Member
0 Kudos

Hello Svetlana,

I have used this Badi to change the logic of the base value calculation:

Net book value minus unplanned depreciation of the year, please find below the example:

******************************************************************************

method IF_EX_FAA_EE_CUSTOMER~SET_BASE_VALUE.

  • "calculation of net value

  • "setting BASEVALUE, BASEVAL_PREV in 'calcdata'

constants GC_BASEVAL_NETV type FAA_EE_S_PARAMETER-BASEVAL_KEY value 'ZA'. "#EC NOTEXT

constants GC_PERCENT_REML type FAA_EE_S_PARAMETER-PERCENT_KEY value 'R '. "#EC NOTEXT

constants GC_PERCENT_RMLC type FAA_EE_S_PARAMETER-PERCENT_KEY value 'U '. "#EC NOTEXT

constants GC_PERCENT_USFL type FAA_EE_S_PARAMETER-PERCENT_KEY value 'D '. "#EC NOTEXT

constants GC_PERCENT_STAP type FAA_EE_S_PARAMETER-PERCENT_KEY value 'P '. "#EC NOTEXT

constants GC_TYPE_ORDN type FAA_EE_S_PARAMETER-AMOUNT_TYPE value 'N'. "#EC NOTEXT

FIELD-SYMBOLS: <ls_segment> TYPE faa_ee_s_segment,

<ls_parameter> TYPE faa_ee_s_parameter,

<ls_areasign> TYPE faa_ee_s_areasign,

<ls_cumvalue> TYPE faa_ee_s_cumvalue,

<ls_calcamount> TYPE faa_ee_s_calcamount,

<ls_calcdata> TYPE faa_ee_s_calcdata.

DATA: ld_basevalue TYPE faa_ee_s_calcdata-basevalue,

ld_baseval_prev TYPE faa_ee_s_calcdata-basevalue,

ld_value_prev TYPE faa_ee_s_calcdata-basevalue.

*{replaced by PMZ

*/ ASSIGN: csx_data-s_segment TO <ls_segment>.

ASSIGN: isx_cdata-s_segment TO <ls_segment>.

*}replaced by PMZ

ASSIGN: <ls_segment>-ref_parameter->* TO <ls_parameter>.

CHECK: <ls_parameter> IS ASSIGNED.

CHECK <ls_parameter>-baseval_key = gc_baseval_netv.

ASSIGN: <ls_segment>-ref_cumvalue->* TO <ls_cumvalue>,

<ls_segment>-ref_calcamount->* TO <ls_calcamount>,

<ls_segment>-ref_calcdata->* TO <ls_calcdata>,

<ls_segment>-ref_areasign->* TO <ls_areasign>.

CHECK: <ls_cumvalue> IS ASSIGNED,

<ls_calcamount> IS ASSIGNED,

<ls_calcdata> IS ASSIGNED,

<ls_areasign> IS ASSIGNED.

  • "calculating net value to the beginning of year

ld_value_prev =

  • "cumulated, posted, proportional values related to previuos years

  • "proportional values of the current year are not included

<ls_cumvalue>-prev_prev-apc +

<ls_cumvalue>-prev_prev-invs +

<ls_cumvalue>-prev_prev-downp +

<ls_cumvalue>-prev_prev-resv +

<ls_cumvalue>-prev_prev-revl +

<ls_cumvalue>-prev_prev-revl_d +

<ls_cumvalue>-prev_prev-depr_o +

<ls_cumvalue>-prev_prev-depr_s +

<ls_cumvalue>-prev_prev-depr_u +

<ls_cumvalue>-prev_cur-revl +

<ls_cumvalue>-prev_cur-revl_d.

ld_baseval_prev = ld_value_prev +

  • "calculated amounts related to previuos years

  • "planned values of the current year are not included

<ls_calcamount>-prev-revl +

<ls_calcamount>-prev-revl_d.

ld_basevalue =

ld_value_prev +

  • "posted, proportional values related to the current year

  • "proportional values of the current year are not included

<ls_cumvalue>-cur-apc +

<ls_cumvalue>-cur-invs +

<ls_cumvalue>-cur-downp +

<ls_cumvalue>-cur-resv +

<ls_cumvalue>-cur-revl +

<ls_cumvalue>-cur-revl_d +

  • "total calc. amounts

  • "planned values of the current year are not included

<ls_calcamount>-total-revl +

<ls_calcamount>-total-revl_d.

CASE <ls_parameter>-percent_key.

WHEN gc_percent_reml OR

gc_percent_rmlc.

  • "in case 'percentage from remaining life' = 'R' or 'U'

  • "planned and proprtional values of the current year should be added

  • "as base value should be the current net value

ld_baseval_prev = ld_baseval_prev +

<ls_cumvalue>-prev_cur-depr_o +

<ls_cumvalue>-prev_cur-depr_s +

<ls_cumvalue>-prev_cur-depr_u +

<ls_calcamount>-prev-depr_o +

<ls_calcamount>-prev-depr_s.

ld_basevalue = ld_basevalue +

<ls_cumvalue>-prev_cur-depr_o +

<ls_cumvalue>-prev_cur-depr_s +

<ls_cumvalue>-prev_cur-depr_u +

<ls_cumvalue>-cur-depr_o +

<ls_cumvalue>-cur-depr_s +

*{PMZ removal

  • <ls_cumvalue>-cur-depr_u +

*}PMZ

<ls_calcamount>-total-depr_o +

<ls_calcamount>-total-depr_s.

WHEN gc_percent_usfl OR

gc_percent_stap.

  • "special depreciation should be included to the base value

  • "for ordinary depreciation in declining balance method

IF ( <ls_areasign>-depr_o_first IS INITIAL AND

<ls_segment>-amount_type = gc_type_ordn ).

ld_baseval_prev = ld_baseval_prev +

<ls_cumvalue>-prev_cur-depr_s +

<ls_calcamount>-prev-depr_s.

ld_basevalue = ld_basevalue +

<ls_cumvalue>-prev_cur-depr_s +

<ls_cumvalue>-cur-depr_s +

<ls_calcamount>-total-depr_s.

ENDIF.

ENDCASE.

  • setting base value

<ls_calcdata>-baseval_prev = ld_baseval_prev

  • <ls_parameter>-baseval_factor.

<ls_calcdata>-basevalue = ld_basevalue

  • <ls_parameter>-baseval_factor.

CS_CALCDATA = <ls_calcdata>.

ENDMETHOD.

******************************************************************************

This is a copy of standard method BASEVALNETV_CALC.

Private section's constants of the method had to be added, including GC_BASEVAL_NETV I set to the value 'ZA' corresponding to my customizing.

Regards,

Joel GREA

Former Member
0 Kudos

Dear Joel,

Thank you very much for the helpful answer.

Actually I have already found the solution but in my case basic asset data like Company Code, Asset and Subasset numbers, Initial Acquisition year was required. I was not able to access this information from method FAA_EE_CUSTOMER~SET_BASE_VALUE.

That is why I have also implemented method FAA_DC_CUSTOMERSET_PARAMETER where all the necessary data was available. In this implementation I calculate new base value, save it in the table ct_parameter which is available also in the method FAA_EE_CUSTOMERSET_BASE_VALUE.

Thanks a lot and best regards,

Svetlana

Former Member
0 Kudos

hi svetlana,

could yuo publish the code of your implementation, please?

i need to know how to get asset id in FAA_EE_CUSTOMER or in FAA_DC_CUSTOMER and pass it to FAA_EE_CUSTOMER.

thank you.

bye,

ivan

Edited by: Ivan Lo Torto on Jun 12, 2009 11:58 AM