How To Fix SD_CDS_ENTITY117 - Entities subject to access control should declare a key (see long text)


SAP Error Message - Details

  • Message type: E = Error

  • Message class: SD_CDS_ENTITY - Messages for STOBS/entities

  • Message number: 117

  • Message text: Entities subject to access control should declare a key (see long text)

  • Show details Hide details
  • What causes this issue?

    CDS entity may be subject to access control but does not declare a key.

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.

    System Response

    This situation is reported as warning.
    The declared key columns may be utilized by CDS access control to
    construct an extension to database statements for this entity to
    enforce the access control conditions.
    When there are no declared key columns, this enforcement is still
    possible, but it must then consider all columns of the entity as
    necessary to formulate this integration. For entities with many
    columns, this might result in large join conditions.
    Furthermore, for some types of integration, it requires the usage
    of temporary database objects with a DISTINCT property, which is
    also an expensive operation.

    How to fix this error?

    Unless there are comprehensive business reasons which make the
    declaration of a key not feasible, specify which columns of the entity
    represent a key property of the entity, that is, there are not two
    records with the same set of values in those columns. When doing so, you
    must ensure that this condition is fulfilled. Specification of a key
    column set which does not have the uniqueness property may result in
    duplicate records being returned once access control becomes active.
    When you use aggregation functions, those duplications might produce
    wrong results.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message SD_CDS_ENTITY117 - Entities subject to access control should declare a key (see long text) ?

    The SAP error message SD_CDS_ENTITY117 indicates that there is an issue with the definition of a Core Data Services (CDS) view in the context of access control. Specifically, it suggests that the entities defined in the CDS view do not have a key declared, which is necessary for access control mechanisms to function properly.

    Cause:

    The error typically arises when:

    1. A CDS view is defined without a primary key or unique identifier for the entity.
    2. The system requires a key to enforce access control rules, and without it, the system cannot determine how to apply these rules effectively.

    Solution:

    To resolve this error, you need to ensure that the CDS view includes a key declaration. Here are the steps to do this:

    1. Open the CDS View Definition: Go to the ABAP Development Tools (ADT) in Eclipse or the relevant transaction in SAP GUI where the CDS view is defined.

    2. Add a Key Declaration: In the CDS view definition, you need to specify a key for the entity. This is typically done using the @Key annotation. For example:

      define view my_cds_view
      as select from my_table
      {
          key field1,
          field2,
          field3
      }
    3. Activate the CDS View: After making the changes, activate the CDS view to ensure that the changes take effect.

    4. Test the CDS View: After activation, test the CDS view to confirm that the error has been resolved and that access control is functioning as expected.

    Related Information:

    • Access Control in CDS Views: Access control in CDS views is crucial for ensuring that users can only access data they are authorized to see. This is typically managed through authorization objects and roles in SAP.
    • Documentation: Refer to the official SAP documentation on Core Data Services and access control for more detailed information on how to define keys and manage access control.
    • SAP Notes: Check for any relevant SAP Notes that might provide additional insights or updates related to this error message.

    By ensuring that your CDS views are properly defined with keys, you can avoid this error and maintain effective access control in your SAP environment.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker