Show TOC

Adding Alternative KeysLocate this document in the navigation structure

This option allows you to create an alternative key.

Context

You create alternative keys to identify a node instance. Alternative keys are usually used as an entry point for the consumer to get keys of node instances. Unlike queries, alternative key calls can also be made on the transactional image.

You can classify alternative keys as:

  • Structured: relates to multiple attributes of the same node
  • Unstructured: relates to a single attribute of a node

Procedure

  1. In the Project Explorer view, choose a business object.
  2. In the context menu, choose Open.

    The Overview page appears.

  3. Choose the Nodes page.
  4. Select a node.
  5. Press Ctrl + click to open the node Overview page.
  6. Choose the Alternative Keys page.
  7. Choose New.
  8. In the New Alternative Key wizard, enter the following details:
    1. Name: Enter a name for the alternative key.
    2. Description: This is an optional field. Enter a short description of the purpose of the alternative key.
    3. Uniqueness: choose any of the following options:
      • Unique: This option ensures that the value of the alternative key is unique.
      • Unique if attributes not initial: This option ensures that the value of the alternative key is unique if the value is not initial (not null).
      • Not unique: This option ensures that more than one node instance can have identical alternative key values.
    4. In the Uniqueness Check section, choose Check After Modify to perform a check after the value is submitted for modification. If you don't want to perform a uniqueness check, choose No Check.
  9. Choose Finish.

    The alternative key is displayed in the Alternative Keys page.

  10. Select the alternative key.
  11. Press Ctrl + click on the alternative key name to open the alternative key Overview page.
  12. In the Key Fields section, choose Add.

    The Element Selection dialog appears.

  13. Select one or more elements.
  14. Choose Finish.
    Note

    The Data type and Data Table Type fields are auto-populated.

  15. Save the alternative key.
  16. To check for correctness of business object, choose (Check ABAP Development Object) from the toolbar.
    Note

    To check for errors, use the Problems view.

  17. To activate the Business object, choose Edit > Activate ABAP Development Object.

    TIP

    You can also use (Activate ABAP Development Object) in the toolbar.