Sunday, 14 October 2012

VARIANTS in SAP - Part I

What are variants?

In SAP ABAP reports have a mechanism for entering values for database selection or for performing different calculations through SELECTION SCREENS.

Selection screen provides a user an option to execute the reports or transactions as per his requirements and thus provide a range of values as an input.

Whenever there is a requirement to execute a report with the same set of input values again and again, for large selection screens entering the same values can be a tiresome and boring task. Thus SAP has provided a functionality to save these values in a set called as VARIANTS.

Variants can prove to be useful in various ways:
  1. As mentioned above, when there is a requirement to execute a report with a same set of values every time.
  2.  When a report needs to be executed in background mode, variants are the only way to pass values to the report.
  3.  Variants can ensure the integrity of the data being passed as an input and thus minimize the risk of incorrect data entry.

TYPES OF VARIANTS:  Variants values can be Static or Dynamic.

STATIC: Static values are fixed values and do not change over the course of time. 

Example: Let us suppose there is an organization with 10,000 employees and the HR executes a  monthly report having the personnel number as input ,each month. Then in this case we can use the static value giving the range as 1 to 10,000 for this.

DYNAMIC: Dynamic values in a variant can change over time.

Example: The HR wants to execute the report daily and gives the current date as the input. The requirement is that next day when the report is executed the date should be changed to current date.
In such case we can use dynamic values. If the dynamic value is a date , we can use the different date calculation options provided by SAP.
In other cases we can use the values stored in table TVARVC (ECC 6.0 Version) and TVARV (SAP 4.6 ).

PROTECTION OF VARIANTS:
Variants can be saved as protected variants so that only the creator has the authority to change the variant at a later point of time. This can be done by selecting the checkbox for variant protection at the time time of saving variant attributes.

No comments:

Post a Comment