Show TOC

Object documentationGlobal Attribute Tag

 

A global attribute tag is a semantic identifier (ID) that allows you to expose and consequently access application and system data.

You can tag different application and system attributes by assigning a unique, untranslatable ID to them. This ID can be used to reference and retrieve attribute values within the context of a business object (application).

You can tag the following types using global attribute tags:

  • Business object layer (BOL) attributes

  • Constants (literals)

  • User variable attributes

You tag BOL attributes for a specific UI object type. A UI object type corresponds to a business object. You can determine the UI object type assigned to the corresponding application overview page by pressing F2.

You create global attribute tags in Customizing for UI Framework under Start of the navigation path UI Framework Definition Next navigation step Global Attribute Tags End of the navigation path.

 

The following applications use global attribute tags:

  • Tag clouds

    For more information, see Tag Clouds.

  • Embedding of rapid applications and UIs generated from a BOL model

    For more information about rapid applications, see Rapid Applications.

    For more information about UIs that were generated from a BOL model, see Generation of UI from a BOL Model.

  • Mash-ups

    For more information, see Mash-Ups.

  • Calculated fields (created using the Application Enhancement Tool)

    For more information, see Adding Fields.

For most applications, SAP delivers only some examples of BOL attribute tags. You can create more attribute tags according to your business requirements.

Each UI object type is assigned to a BOL root object. When you tag a BOL attribute, you start from that BOL root object. You can navigate through the BOL model using the BOL relationships and tag any attribute that matches your requirements. As a result, you tag a BOL path and give it a semantic ID.

Note Note

Note the following information about how applications use global attribute tags:

  • Tag clouds

    Global attribute tags are used to specify the columns in the tag search result list. For more information, see documentation in Customizing for UI Framework under Start of the navigation path UI Framework Definition Next navigation step Tag Clouds End of the navigation path.

  • Embedding of rapid applications and mash-ups

    If you tagged a BOL attribute path that contains 1:n or 0:n BOL relationships, at runtime, the tag evaluation results in a table with more than one entry. The reason for this is that the system starts evaluating the BOL path from the BOL root object.

    However, when embedding views of rapid applications, you have to map to a single value. In mash-ups, there is no standard way to convert a table to a string. Therefore, in both cases, the system returns only the first entry of the obtained table.

    Example Example

    You tagged an attribute in order items. The BOL path starts from the header (main BOL entity), goes through the 1:n relationship and points to an item attribute. Since an order can have more than one item, the result is a table that contains the attribute values from all the existing items. When parsing such a result, the system uses the first entry from the table and returns the corresponding attribute value.

    End of the example.
  • Calculated fields

    You create calculated fields at the business object part. The business object part points to a specific BOL object, which is not necessarily a root object.

    Example Example

    You tag an attribute in the items. The BOL path contains a 1:n relationship.

    If you create a calculated field in the header, the BOL path is evaluated starting from the header BOL entity (usually the root object). The behavior is the same when you embed views and mash-ups. The tag value is a table.

    However, you can create a calculated field for an item. The evaluation begins at the corresponding BOL entity, which is the item. The resulting path no longer contains a 1:n relationship. Therefore, at runtime, the attribute tag returns a single value (the attribute value from the current item).

    End of the example.

    If an attribute tag returns a table value, you have the following options:

    • You can use table operations like summation, maximum, minimum, and average. These appear in the list of the available operations under Table Functions. The result of these functions is a single value, for example, the result of counting the number of existing items.

    • You can use the operations listed under Functions for First Table Row to get the first entry from a table.

      Example Example

      Your organization decides to have only one contact for each account. Contacts are connected to the account header using a 1:n relationship. An attribute tag from the contacts returns a table if the attribute tag is used at the account header level. However, in your business processes, there can be only one contact. The Functions for First Table Row allow you to retrieve an attribute from your only contact and use it in your calculations.

      End of the example.

    For more information, see Calculated Field.

End of the note.

Caution Caution

Global attribute tags are client-dependent. Therefore, you can create tags with the same name but different BOL paths in different clients. Do not define such tags. Some global attribute tag consumers are client-independent, for example, calculated fields created using the Application Enhancement Tool.

In addition, make sure that the tags you created are transported together with the enhancements that use them.

End of the caution.

Example

In the BP_ACCOUNT UI object type, you tag the BP_NUMBER attribute from the BOL object (BuilHeader). You call this attribute tag BP_ID. You create another attribute tag called CONTACT_ID that references the ID of the account’s contacts (BuilHeader/BuilContactPersonRel/@CONP_NUMBER). The BOL path of CONTACT_ID contains a 1:n relationship, namely BuilContactPersonRel.

Embedding of Views and Creation of Mash-ups

You can use BP_ID when you embed views or create mash-ups. CONTACT_ID returns a table. At runtime, the system uses the first entry in the table. Therefore, when embedding views or creating mash-ups, use this tag attribute only if you are interested in the first contact.

Calculated Fields

You create a calculated field in the account header. BP_ID returns a single value. CONTACT_ID returns a table. You can use the table operations and retrieve information related to the contact’s tagged attribute. For example, you can count the number of contacts.

If you create a calculated field in the contacts, you cannot access BP_ID, since it belongs to the header.