Steps to Create Dynamic Variant on Date Selection for ABAP Program

Share this article :

There are some cases where the job scheduling in SAP system required dynamic date range selection. Standard date selection from the system will only cater for normal job scheduling.

In this example, we will set up the variant which will set the ABAP program to run and fetch data in SAP system for past 2 months from today’s execute date.

1. Execute transaction code SE38 and fill in the ABAP program. Press F8 (Execute). The next screen will show you the program executable page.

2. Now, click on Save as Variant. Fill in all the necessary information such as the Variant Name, Description and etc.

3. On Objects for selection screen, look for Date Range. Under Selection Variable, double click or press F4 – choose D: Dynamic Date Calculation.

Dynamic Variant - Selection Variables

4. Next, under Name of Variable (Input Only Using F4), press F4 and select Current date – xxx, current date + yyy.

Dynamic Variant - Selection Variables2

5. Specifically for this example, the data required is for the last 2 months – so, we need to put 60 as below screenshot.

Dynamic Variant - Selection Variables3

6. Save your changes and you can now use the created variant when you schedule the job.


Our post above might be very short and straight forward. You can also refer to below dynamic variant related article from the SAP Wiki.

Related posts

SM28: SAP Initial Inconsistency Check
SAP Gateway Time Out Parameters
Accessing to SAP SLD
Find SAP Variant Last Changed By & Time
© 2017 ITsiti. All Rights Reserved
Powered by KEEM