How To Fix SADL_GW_DT_CDS028 - Annotation 'ObjectModel.writeDraftPersistence' is missing in CDS view &1.


SAP Error Message - Details

  • Message type: E = Error

  • Message class: SADL_GW_DT_CDS - Messages CDS Checks

  • Message number: 028

  • Message text: Annotation 'ObjectModel.writeDraftPersistence' is missing in CDS view &1.

  • Show details Hide details


  • Self-Explanatory Message

    Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.

    To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.

    Unfortunately, there isn't any extra information in this error notice.



    What else can you do?

    First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).

    Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.

    You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.


Smart SAP Assistant

  • What is the cause and solution for SAP error message SADL_GW_DT_CDS028 - Annotation 'ObjectModel.writeDraftPersistence' is missing in CDS view &1. ?

    The SAP error message SADL_GW_DT_CDS028 indicates that there is a missing annotation ObjectModel.writeDraftPersistence in a Core Data Services (CDS) view. This annotation is essential for enabling draft handling in the context of the SAP Gateway and OData services.

    Cause:

    The error typically arises when:

    1. The CDS view is intended to support draft functionality (e.g., for UI applications that require draft capabilities), but the necessary annotation is not defined in the CDS view.
    2. The CDS view is being used in a scenario where draft management is expected, such as in Fiori applications or when integrating with SAP S/4HANA.

    Solution:

    To resolve this error, you need to add the missing annotation to the CDS view. Here’s how you can do that:

    1. Open the CDS View: Use the ABAP Development Tools (ADT) in Eclipse or the SAP GUI to access the CDS view definition.

    2. Add the Annotation: Include the @ObjectModel.writeDraftPersistence: true annotation in the CDS view definition. This annotation indicates that the view supports draft persistence.

      Here’s an example of how to add the annotation:

      @AbapCatalog.sqlViewName: 'Z_MY_CDS_VIEW'
      @AbapCatalog.compiler.compareFilter: true
      @ObjectModel.writeDraftPersistence: true
      define view Z_MY_CDS_VIEW as select from my_table
      {
          key field1,
          field2,
          ...
      }
    3. Activate the CDS View: After making the changes, activate the CDS view to ensure that the changes take effect.

    4. Test the OData Service: If the CDS view is part of an OData service, regenerate the service and test it to ensure that the error is resolved.

    Related Information:

    • Draft Handling in SAP: Draft handling is a feature that allows users to create and edit data without immediately saving it to the database. This is particularly useful in UI applications where users may want to make multiple changes before committing them.
    • Annotations in CDS Views: Annotations in CDS views provide metadata that can influence the behavior of the view in various contexts, such as UI rendering, OData service generation, and more.
    • SAP Fiori Applications: Many Fiori applications rely on draft handling for better user experience, allowing users to save their work in progress.

    If you continue to experience issues after adding the annotation, ensure that there are no other underlying problems with the CDS view or its dependencies.

    • 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
The AI Support Assistant is great. It provides comprehensive assistance even on the most difficult issues. I highly recommend this service.
Rate 1
John Jordan
SAP Consultant & Author