You are on page 1of 9

Dynamic Variant Creation

Applies to:
SAP ECC 6.0

Summary
This document helps people to create dynamic date variants which can be used for scheduling background jobs and also for foreground execution of the report. Author: Sai Ram Reddy Neelapu

Company: Atos Origin - Singapore Created on: 29 March 2011

Author Bio

Sai Ram Reddy Neelapu working as Sr. ABAP Consultant with Atos Origin for past 5+ years.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Dynamic Variant Creation

Table of Contents
What is Variants? ................................................................................................................................................ 3 Purpose of dynamic variants .............................................................................................................................. 3 Variant creation Steps ..................................................................................................................................... 3 Related Content .................................................................................................................................................. 8 Disclaimer and Liability Notice ............................................................................................................................ 9

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Dynamic Variant Creation

What is Variants?
Variants allow you to save sets of input values for programs that you often start with the same selections.

Purpose of dynamic variants


Sometimes you may have a requirement to schedule a back ground jobs, based on the current month in the selection screen. Ex: You want to run your Payroll interface based on the pay periods, so you may need to have a variant for different month. To overcome the above scenario, SAP has given more flexibility to do the things. Here in this document, I will cover how to create variant that changes dynamically based on the calendar month. Variant creation Steps
Transaction code for creating report variant: SE38

1. Go to SE38, enter the report program name and select radio buttons variants and press Display
Note: There are few different ways of creating report variants, out of which below example is one way of doing it.

2. Enter desired variant name, in below screen represented as DEMO_DYNAMIC and Press Create.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Dynamic Variant Creation

3. You will be taken to the below screen, press Attributes button to maintain your dynamic variables.

4. Go to selection variable (as shown below) and press F4 (value help) and select D (i.e. for dynamic date calculation)

5. Press F4, under Name of Variable (input Only Using F4), you will be taken to the below highlighted screen.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Dynamic Variant Creation

6. You choose the respective variable that suits your requirement. Now, Let us assume that in our scenario we want to select the date range for start day of previous month and end day of current month. Double click the variable that matches our scenario (as shown below)

On pop-up screen enter the value as shown in below screen. Here XXX = 1 represents, [current month 1]. YYY = 0 represents, [current month + 0]. Press Continue

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Dynamic Variant Creation

7. Press Save.

8. Now you will see the desired results.

Server date:

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Dynamic Variant Creation

Result:

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Dynamic Variant Creation

Related Content
www.help.sap.com http://help.sap.com/saphelp_nw04/helpdata/en/c0/980374e58611d194cc00a0c94260a5/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Dynamic Variant Creation

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

You might also like