Dynamic Selection for Scheduling a Program
Most of the programs can be scheduled based on the static selection like a given plant or a company code. However, when the requirement is to execute the program for dynamic selection like – Current day, Start of the Month to the Current day, we need to dig a little deeper. This paper helps you to schedule the programs with dynamic selections for mandatory and optional fields. This will simply automate the process of scheduling a job dynamically.
I have created a program that replicates MB51 transaction code for this purpose.
|Scheduling||From start of the Current Month to the Current Day|
Go to T-code SE38 and enter the program name:
We need to run this program every day from the start of the month to the current day. These selections are required to be passed into the posting date along with any additional selections for other fields.
In this screen, click on the save icon and you will be directed to the variant creation screen.
Select “L” for Posting Date and then click on the “Selection Variable” button at the top of the current screen in the same screen:
You will be directed to the following screen:
Click on the “Yellow” Traffic Light. The position of traffic lights will change and Yellow light will become in the first place:
Click on the drop-down icon in the Posting Date field for selecting desired variable:
Please note that you can also create custom variable to be available here in the drop-down. The desired variable can then be selected by clicking on the Variable and then on “Choose”.
Your variable has been selected and now click on save icon to save the variant.
Now again go to the transaction code SE38 and enter the program name and call this variant:
The selection screen will appear with posting date filled automatically as per the variable chosen.
Now you can schedule your program dynamically.