(ECC 6.0 SP16)
Scenario:
User would like to have the current month depreciation posting run executed on ME-4 every month. Example: Month end is 30 Sept 2022. Therefore, depreciation should be executed on 26 Sept 2022.
Issue:
Fiscal Year and Posting Period does not have the dynamic calculation option when saving a variant.
Workaround solution:
Utilize standard SAP program RVSETDAT. This program updates both table TVARV and TVARVC for the following variables:
i. RV_ACTUAL_DATE – Updates current system date. Eg. 20220930
ii. RV_ACTUAL_MONTH – Updates month based on current system date. Eg. 09
iii. RV_ACTUAL_YEAR – Updates year based on current system date. Eg. 2022
Steps as follows:
- By default, the variables above are not maintained in TVARVC. Therefore, create the variables above in TVARVC via t-code STARV under “Parameter” tab.
- Save AFAB variant with Fiscal Year and Posting Period field as follows:
- Schedule a job with the following steps:
Step 1
Execute program RVSETDAT.
This would update the values in table TVARVC.
Step 2
Execute program RAPOST2000 with the variant saved in Step #2 above.
Fiscal Year and Posting Period is derived from TVARVC:
Summary:
If the above solution does not work for some reason, create a Z program based on RVSETDAT logic with Z variable to suit your requirement.
Example 1
Fiscal Year is not calendar year ie. fiscal year for calendar year 2022 is 2023.
- Create a Z program based on RVSETDAT logic
- Derive Fiscal Year with own logic ie. get year from current system date and +1
Example 2
Schedule job to be executed on 2nd working day for the depreciation of the previous month.
- Create a Z program based on RVSETDAT logic
- Derive Posting Period with own logic ie. get month from current system date and -1