Purpose:

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.

Items Technical Name
Program ZMB51_DATA_EXTRACT
Variant

TESTVARDY

Scheduling From start of the Current Month to the Current Day

Go to T-code SE38 and enter the program name:

SE38.jpg

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.

Selection.jpg

In this screen, click on the save icon and you will be directed to the variant creation screen.

Variant.jpg

Select “L” for Posting Date and then click on the “Selection Variable” button at the top of the current screen in the same screen:

SV.jpg

You will be directed to the following screen:

VV.jpg

Click on the “Yellow” Traffic Light. The position of traffic lights will change and Yellow light will become in the first place:

TL.jpg

Click on the drop-down icon in the Posting Date field for selecting desired variable:

Variables.jpg

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

Variable Selected.jpg

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:

Program.jpg

The selection screen will appear with posting date filled automatically as per the variable chosen.

Now you can schedule your program dynamically.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply