Scheduling Transaction OB52 as a Background Job

In recent weeks, I have been getting a few questions on how to automate the period opening transaction OB52. My initial reaction was that this was surely information that was pretty widespread and easily found online. However, upon further investigation, I realize that there is not much information out there on this topic. In the few cases where there is information, it is normally commingled with the scheduling of transaction MMPV in the background, and it is sometimes difficult to untangle both requirements.

For those who are still unclear (I am sure that there are few) about the difference between MMPV and OB52, and easy explanation is that MMPV is for inventory-related transactions, while OB52 is for finance-related transactions (OB52 also contains an inventory-related category “M”, just to confuse things even further, but we’ll ignore that for now).

Here are the steps for automating OB52 as a background job.

First, create the selection variables:

  1. Go to transaction STVARV
  2. Click on the “Change” button (Pencil icon) and then the “Create” button (Paper icon)
  3. Enter a Parameter Name and Value as below:
Parameter Name Value


This program will be changed dynamically by scheduling program RVSETDAT as a background job. Therefore you do not need to keep updating the values.

Next create the program variant:

  1. Go to transaction SE38 and enter program RFPERIOD_OPEN (by applying Note 1483900 you can use program RFOB5200).
  2. Enter the Company Code Variant, From Fiscal Year/Period and To Fiscal Year/Period for one or both time frames (just as you would do in OB52).
  3. Enter the Account Type (+) in the “Account Type/Wildcard” field Note, you will have to repeat this for each account type.
  4. Save your settings as a variant. When you get to the variant attributes screen, you need to make the period and year fields dynamic so that you do not need to repeat this every month/year. Therefore in the “Selection Variable” field, select “T” from the drop-down and in the “Name of Variable” field, select the relevant variable that coincides with the field, as shown below:
Field Name Selection Variable Value


Finally schedule the background job:

  1. Go to transaction SM36 and enter a job name
  2. Click on the “Start” condition, click on the Date/Time button and enter the date/time (e.g. first day of the new period) that you want the job to be scheduled for (make sure that the time scheduled, is after the time of the RVSETDAT job).
  3. Click on the “Period Values” button at the bottom of the screen and choose “Monthly” and save your settings. This will take you back to the prior screen where you should save your settings again.
  4. Click on the “Step” button and enter the program name “RFPERIOD_OPEN” and the variant you created in the “Name” and “Variant” fields, the save your settings.

Since the program RFPERIOD_OPEN allows only one value to be entered in the account type field, you will need to create at least six variants (for the “+”, “A”, “D”, “K”, ”M” and “S” values). This also means that you will need to create six steps in your background job to reflect each program variant. With Program RFOB5200 you can enter all account types at once in the variant and hence create only one step in the background job.



Comments are closed.