Supply Chain Management Blogs by Members
Learn about SAP SCM software from firsthand experiences of community members. Share your own post and join the conversation about supply chain management.
Showing results for 
Search instead for 
Did you mean: 
Former Member

Whenever we have to run an SAP Program for which selection data needs to be entered, and in case same data needs to be entered along with the program run for every run, SAP offers option to save sets of input values for programs as “variants”. Therefore, an SAP Program and a variant name can be provided to setup a batch job; the variant taking care of the selection data in the program fields.

Sometimes a few fields in such variants need not keep the same data for the frequent run, but there is a need for “dynamic” update of selection data, for example dates. So a batch job will be scheduled as a one-time activity but for today’s run it takes a particular date; and for tomorrow’s run, it takes updated and new date, without the need to enter or update the variant every day. This is the concept of “dynamic variants” which we shall discuss in this document.

Process to create a dynamic variant is explained as follows:

1. Go to SE38 transaction; enter Program name and execute; then enter all the values in the input fields which are needed and click on “Save” button.

2. System will take you to variant screen; enter the name and description of the variant.

[Image 1- Variant attributes]

3. Select the line of your date - options field from the list and scroll right

4. Double click on "selection variable" column and select "D"

[Image 2- Variant attributes]

5. Double click on "Name of variable" last column and select "Current date - xxx,current date + yyy" system will provide you popup with "Enter a value xxx" and "Enter a value for yyy" and enter value 7 in xxx and 0 in yyy and save the variant .

[Image 3- Variant attributes]

After making the above changes, the “date range” in the date field will keep updating itself as “7 days before current date (date on which program will be run as part of batch job)” till “current date”, meaning it will select last 1 week.

[Image 4- Variant attributes]

Similarly, we can use any other options available in the screen, as per our requirement, namely:

  1. Current Date
  2. From month start to today
  3. Current date +/- ??? days
  4. current date +/- ??? work days
  5. First day of current month
  6. nth working day of current month
  7. First day of next month
  8. First day of previous month
  9. Last day of previous month
  10. Last Day of the Current Month
  11. First quarter ????
  12. Second quarter ????
  13. Third quarter ????
  14. Fourth quarter ????
  15. Current date - xxx,current date + yyy
  16. Date - xxx, Date + yyy (work days)
  17. Previous month
  18. Current period
  19. (Beginning of mth-xx months, end of mth+yy months)

Therefore, using any of the above options available, we can create a dynamic variable suitable for our respective needs.

1 Comment
Labels in this area