AFAB Dynamic Variant for Posting Period and Fiscal Year

(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:

  1. By default, the variables above are not maintained in TVARVC. Therefore, create the variables above in TVARVC via t-code STARV under “Parameter” tab.


  2. Save AFAB variant with Fiscal Year and Posting Period field as follows:



  3. 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.

  1. Create a Z program based on RVSETDAT logic
  2. 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.

  1. Create a Z program based on RVSETDAT logic
  2. Derive Posting Period with own logic ie. get month from current system date and -1

Change SQ01 Local Field

A custom query was created previously by someone else. A user just pointed out to me the report difference vs. standard. I found that some fields were not considered in the custom query and there is a need to change the SQ01 Local Field which is a calculation.

In order to change the Local field, go to SQ01, select the report and click on “Change”.

Go to the third screen (Select Field). At the menu bar, go to: Edit > Local field > Change.

Note: This is only available on this screen.

change-sq01-local-field

Configuring IDoc Inbound Processing for LSMW with BAPI method

I was unable to create LSMW via batch recording for Profit Center creation. So, I ended up creating LSMW via BAPI instead. To do that, I will need to configure IDoc Inbound Processing. IDoc settings are not cross-client. These settings must be configured in each client and for each project where the IDocs are to be used.

idoc-inboung-processing-settings-1

idoc-inboung-processing-settings-3

idoc-inboung-processing-settings-2

idoc-inboung-processing-settings-4

lsmw-with-bapi

References:
https://saptribalknowledge.wordpress.com/2011/07/16/configuring-idoc-processing-for-your-lsmw-project/

https://archive.sap.com/discussions/thread/1042820

https://archive.sap.com/discussions/thread/110090