Use Your Program Variants More Effectively with the Help of TVARV Variables

  • by Mitresh Kundalia, Director — SAP Practice, Quality Systems & Software
  • March 15, 2005
Instead of manually changing the selections in a program variant, you can make the system change the variant values automatically. This saves time, especially if you are running hundreds of reports.
Key Concept

Selection variables fall into three categories:

Date variables (D): Say that you run a daily sales analysis report, with the date parameter entered as today's date. You would not want to create a new variant or change the variant every day. Date variables also support some basic calculations such as current date + xxx days, or current date – yyy days (xxx and yyy can be numbers). You should use date variables, for example, when you need to run programs with parameters such as today's date or the last day of the previous month.

User-specific variables (B): These are especially useful when, for example, all employees need to run a report with their own personnel number. All other selection parameters on the report remain the same, and users enter the employee ID. To put a user-specific parameter value in the selection field, a parameter ID must be created in each user's master record and the program or report should refer to this parameter ID.

TVARV variables (T): Instead of creating a new variant or changing the existing variant each time a field value changes, you can create a variable in table TVARV (table of variables in selection criteria) and assign this variable to the field value. Since these variables are stored in the TVARV table, they are popularly called TVARV variables.

Program variants don't need any introduction, especially to SAP Financials Expert readers. Put simply, instead of entering selection values on a program every time, you save them in a variant. You can create any number of variants for any program and then can use these variants while running the programs and reports.

Though use of variants is common, many people just scratch the surface of what is possible. There is more to the process than just saving a variant by assigning a name and description. Using variables within variants, for example, makes the process more efficient. As noted in the "Key Concept," selection variables are of three types.

I am going to focus on how TVARV variables work, because I have observed that they are underused. One of the reasons may be the way they are described in SAP help documentation. The description says, "These are fixed values from table TVARV. You should use these variables if you want to store static information." This message suggests that these variables are hard-coded and cannot be used for calculations and are more suitable for situations when the period is always "Beginning of the period – 1" and not changing every month.

However, TVARV variables can change. You can maintain the values of the TVARV variables through the report variant screen for each report variant or more efficiently via transaction SM31 (table maintenance) for centrally managing all the variants.

Consider this straightforward example. Say you want to execute the report G/L Account Balances RFSSDL00, as shown in Figure 1, for specific selection criteria. In this example, you are running the G/L balances report for period 11/2004, Company code 0001, account numbers 40000001 to 40000099, and Chart of accounts INT.

Mitresh Kundalia

Mitresh Kundalia heads the SAP practice at Quality Systems & Software ( QS&S is a leading business and technology consulting firm that specializes in delivering superior IT solutions using SAP products. Mitresh is widely acknowledged as a leading SAP expert and has worked on various SAP assignments, including strategic planning, fresh implementations, upgrades, and post-go-live support projects. With an MBA degree in finance, Mitresh manages SAP projects with a special focus on customer-focused solutions, management reporting, profitability analysis, SAP General Ledger, and business intelligence. He is a regular contributor at SAP events and publications and technical advisor to leading journals.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.