Using @functions

Using Advanced @Variable Function Use Cases

Objective

After completing this lesson, you will be able to analyze business requirements to select the appropriate advanced @Variable function in the SAP BusinessObjects Information Design Tool.

Current Report or Query

Variables containing information about the current report or query:

  • DOCNAME: The document name.
  • DOCID: The document identifier.
  • DPNAME: The Data Provider name.
  • DPTYPE: The Data Provider type.
  • UNVNAME: The universe name.
  • UNVID: The universe identifier.

These variables are used in the END_SQL parameter for auditing. For example, they can help administrators identify which specific users are running resource-intensive queries on the database server.

The Parameters button opens a list of SQL parameters, highlighting END_SQL with a value containing user, document, and data provider name variables.

Information About The User's Current Language Settings

Variables containing information about the user's current language settings:

  • PREFERRED_VIEWING_LOCALE: The user's preferred locale for viewing report and query objects in an application.
  • DOMINANT_PREFERRED_VIEWING_LOCALE: A pre-defined fallback locale that is used when no fallback locale is defined for the resource.

For example, assume the database has a PRODUCT table with translations of the product names in many languages. The universe designer needs to return the product names in a specific language, based on the end user’s locale variable.

An object that dynamically displays the product name in the appropriate language would then have the SELECT statement:

Code Snippet
1
SELECT PRODUCT.Product_Name FROM PRODUCT WHERE PRODUCT.LOCALE = @Variable('PREFERRED_VIEWING_LOCALE')

At query time, the Product name for the user’s specific language locale is displayed.

SQL query filters product names by the user’s preferred locale, selecting the matching language version from the product table.

Note

To see a list of locales, their abbreviations and dominant locales, refer to the Translation Management Tool User Guide.

User Attribute Management

User Attributes defined in the User Attribute Management area of the Central Management Console (CMC).

To reference a User Attribute, specify the internal name for the attribute as it is defined in the Central Management Console. @Variable returns the value of the attribute for the current user.

For example, the User Attribute MYCOUNTRY contains the value of the country of each user in the Central Management Console. Specify the attribute's internal name surrounded by single quotes: @Variable('SI_MYCOUNTRY'). The attribute’s internal name is defined when the attribute is created in the Central Management Console.

Note

For more information about this topic, please read Manage Attributes for System Users

Let's Summarize What You've Learned

  • Use system variables to capture report, query, and user details for auditing and analysis.
  • Leverage language locale variables to display report data in the user’s preferred language.
  • Reference user attributes from the Central Management Console to personalize report content for each user.