<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Behavior validation messages are not displayed in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14017450#M4903531</link>
    <description>&lt;P&gt;The code shown worked for me on a SAP BTP ABAP Environment system (latest release 2502).&lt;BR /&gt;&lt;BR /&gt;I had however to perform a few changes because when using cut and paste syntax errors were shown.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1. Not sure why we see a "slash" here:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;READ ENTITIES OF /zi_product IN LOCAL MODE&lt;/LI-CODE&gt;&lt;P&gt;2. In the BDEF in the validation statement a semicolon is missing&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;validation validateMandatoryFields on save { field ProductName create; }&lt;/LI-CODE&gt;&lt;P&gt;must read&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;validation validateMandatoryFields on save { field ProductName; create; }&lt;/LI-CODE&gt;&lt;P&gt;And I saw&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andre_Fischer_0-1739560495683.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/225996i08E289D6B5EAA0C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andre_Fischer_0-1739560495683.png" alt="Andre_Fischer_0-1739560495683.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&amp;nbsp;&lt;BR /&gt;You have not mentioned on which release you are working ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2025 19:16:24 GMT</pubDate>
    <dc:creator>Andre_Fischer</dc:creator>
    <dc:date>2025-02-14T19:16:24Z</dc:date>
    <item>
      <title>Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaq-p/13761252</link>
      <description>&lt;P&gt;Validation error messages in a behavior implementation are not displayed and elements are not highlighted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the behavior implementation for a draft enabled RAP based Fiori Elements application there is a custom check for mandatory fields. If a mandatory field is not filled, an error message should be displayed and the relevant element should be highlighted. The validation is executed correctly and the save action is stopped but only a generic error message ("&lt;SPAN&gt;Resolve data inconsistencies to save changes.&lt;/SPAN&gt;") is displayed and no field is highlighted. When the app runs in preview mode via the Service Binding in Eclipse, the validation messages are correctly displayed and the relevant fields highlighted. The issue only occurs if the app runs in the Fiori Launchpad.&lt;/P&gt;&lt;P&gt;Behavior definition:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;managed implementation in class zbp_i_product unique;
strict ( 2 );
with draft;

define behavior for ZI_Product alias product
persistent table za_product
draft table zd_product
authorization master ( instance )
lock master
total etag LastChangedAt
etag master LastChangedAt
{
  create;
  update;
  delete;

  field ( mandatory ) ProductName;
  field ( readonly, numbering : managed ) ProductUuid;
  field ( readonly ) CreatedBy, CreatedAt, LastChangedBy, LastChangedAt;

  validation validateMandatoryFields on save { field ProductName create; }

  mapping for za_product
    {
      ProductUuid = product_uuid;
      ProductName = product_name;
      ProductType = product_type;
      CreatedBy = created_by;
      CreatedAt = created_at;
      LastChangedBy = last_changed_by;
      LastChangedAt = last_changed_at;
    }

  draft determine action Prepare
  {
    validation validateMandatoryFields;
  }
  draft action Edit;
  draft action Activate optimized;
  draft action Discard;
  draft action Resume;

}&lt;/LI-CODE&gt;&lt;P&gt;Behavior implementation:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;CLASS lhc_product DEFINITION INHERITING FROM cl_abap_behavior_handler.
  PRIVATE SECTION.
    METHODS validatemandatoryfields FOR VALIDATE ON SAVE
      IMPORTING keys FOR product~validatemandatoryfields.
ENDCLASS.


CLASS lhc_product IMPLEMENTATION.
 METHOD validatemandatoryfields.
    READ ENTITIES OF /zi_product IN LOCAL MODE
         ENTITY product
         FIELDS ( ProductName )
         WITH CORRESPONDING #( keys )
         RESULT DATA(products).

    LOOP AT products ASSIGNING FIELD-SYMBOL(&amp;lt;product&amp;gt;).
      APPEND VALUE #( %tky        = &amp;lt;product&amp;gt;-%tky
                      %state_area = 'VALIDATE_MANDATORY' )
             TO reported-product.

      IF &amp;lt;product&amp;gt;-ProductName IS INITIAL.
        APPEND VALUE #( %tky = &amp;lt;product&amp;gt;-%tky ) TO failed-product.
        APPEND VALUE #( %tky              = &amp;lt;product&amp;gt;-%tky
                        %state_area       = 'VALIDATE_MANDATORY'
                        %msg              = new_message( id = `ZPRODUCT`
                                                         number = 009 
                                                         severity = if_abap_behv_message=&amp;gt;severity-error )
                        %element-ProductName= if_abap_behv=&amp;gt;mk-on ) TO reported-product.
      ENDIF.
    ENDLOOP.
  ENDMETHOD.

ENDCLASS.&lt;/LI-CODE&gt;&lt;P&gt;The Fiori app is created as a Fiori Elements List Report based on an OData V4 service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 15:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaq-p/13761252</guid>
      <dc:creator>PatrickAngevare</dc:creator>
      <dc:date>2024-07-15T15:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13852019#M4881583</link>
      <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;I'm having the same issue. Were you able to resolve it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 00:56:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13852019#M4881583</guid>
      <dc:creator>abhiperiwal</dc:creator>
      <dc:date>2024-09-03T00:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13860202#M4882731</link>
      <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;I'd appreciate if you can let me know if you were able to solve this issue. I'm having the same issue where the preview version from eclipse shows the validation errors correctly but after creating the app in BAS and after deployment, the validations errors are not shown on the UI. I am using precheck update to display the messages for now but I'd prefer to handle it using validations as it should be.&lt;/P&gt;&lt;P&gt;I'm on S/4 HANA on premise, ABAP 2022.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/55"&gt;@Andre_Fischer&lt;/a&gt;, please provide your inputs.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 04:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13860202#M4882731</guid>
      <dc:creator>abhiperiwal</dc:creator>
      <dc:date>2024-09-10T04:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13863955#M4883332</link>
      <description>&lt;P&gt;In my case Messages are displayed when &lt;SPAN&gt;%state_area&lt;/SPAN&gt; is removed, but still fields are not highlighted.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:41:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13863955#M4883332</guid>
      <dc:creator>GauravGaurav</dc:creator>
      <dc:date>2024-09-12T13:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13864069#M4883351</link>
      <description>In my case Messages are displayed when %state_area is removed, but still fields are not highlighted.</description>
      <pubDate>Thu, 12 Sep 2024 15:24:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13864069#M4883351</guid>
      <dc:creator>GauravGaurav</dc:creator>
      <dc:date>2024-09-12T15:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13864287#M4883385</link>
      <description>Can you debug and check following line? %element-ProductName= if_abap_behv=&amp;gt;mk-on ) TO reported-product.</description>
      <pubDate>Thu, 12 Sep 2024 19:09:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13864287#M4883385</guid>
      <dc:creator>kyo_choi73</dc:creator>
      <dc:date>2024-09-12T19:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13916561#M4889456</link>
      <description>I am having the same problem.</description>
      <pubDate>Wed, 23 Oct 2024 06:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/13916561#M4889456</guid>
      <dc:creator>SilvanoSilva</dc:creator>
      <dc:date>2024-10-23T06:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14003135#M4901460</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/162234"&gt;@PatrickAngevare&lt;/a&gt;Explorer Have you found the solution. I am also facing the same issue. My UI version is 1.108.27 and s4 is 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even I tried to refresh the messages using side effects for Activate action to refresh the messages. The message odata call is&amp;nbsp; not happening. But in ADT preview and BAS preview the SAP_Messages property GET call is happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 15:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14003135#M4901460</guid>
      <dc:creator>udayagiri_swamy</dc:creator>
      <dc:date>2025-01-31T15:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14017450#M4903531</link>
      <description>&lt;P&gt;The code shown worked for me on a SAP BTP ABAP Environment system (latest release 2502).&lt;BR /&gt;&lt;BR /&gt;I had however to perform a few changes because when using cut and paste syntax errors were shown.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1. Not sure why we see a "slash" here:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;READ ENTITIES OF /zi_product IN LOCAL MODE&lt;/LI-CODE&gt;&lt;P&gt;2. In the BDEF in the validation statement a semicolon is missing&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;validation validateMandatoryFields on save { field ProductName create; }&lt;/LI-CODE&gt;&lt;P&gt;must read&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;validation validateMandatoryFields on save { field ProductName; create; }&lt;/LI-CODE&gt;&lt;P&gt;And I saw&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Andre_Fischer_0-1739560495683.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/225996i08E289D6B5EAA0C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Andre_Fischer_0-1739560495683.png" alt="Andre_Fischer_0-1739560495683.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&amp;nbsp;&lt;BR /&gt;You have not mentioned on which release you are working ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 19:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14017450#M4903531</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2025-02-14T19:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14111033#M4915013</link>
      <description>Dears, was this issue solved..? we are on S4HANA ON PREMISE SAP S/4HANA 2022 (SP/FP 02 (05/2023) ).. I am facing exactly same issue.. my custom validation is not displayed and only we get to see the message ("Resolve data inconsistencies to save changes.").. any guidance would be helpful.. best regards,</description>
      <pubDate>Sun, 25 May 2025 13:48:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14111033#M4915013</guid>
      <dc:creator>AZIZURRAHMAN</dc:creator>
      <dc:date>2025-05-25T13:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14129662#M4917237</link>
      <description>I am facing also the problem on the same Release like AZIZURRAHMAN S4HANA ON PREMISE SAP S/4HANA 2022 (SP/FP 02 (05/2023) ). Is there in the meanwhile an update about the topic of validations not shown in released Apps?</description>
      <pubDate>Tue, 17 Jun 2025 10:38:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14129662#M4917237</guid>
      <dc:creator>chrisp_</dc:creator>
      <dc:date>2025-06-17T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178489#M4922696</link>
      <description>&lt;P&gt;Hello Patrick&lt;/P&gt;&lt;P&gt;not sure if you found already a solution for the problem on your own. After some research and trial and error i found a solution on our release (S4HANA onPrem 2023).&lt;/P&gt;&lt;P&gt;To force the request for state messages from frontend, you have to add for the action (in your case Draft-Action PREPARE) that is initially triggered for the generation of messages a &lt;STRONG&gt;side effect&lt;/STRONG&gt; which &lt;STRONG&gt;affects messages&lt;/STRONG&gt; in the behavior definition. Here you then have various options to define e.g. the field or the entity that is used in a validation. So all of the fields or entities (or $self -&amp;gt; for the root entity) must not only be definied in the validation, but also in the side effect with an effect on messages, otherwise the messages were not shown in my case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this not leads to success, also consider to adjust the CONSUMPTION BEHAVIOR DEFINITION with the extension of&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG&gt;use side effects;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;on top level.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;i adjusted your initial version of the behavior with the corresponding side effect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;managed implementation in class zbp_i_product unique;
strict ( 2 );
with draft;

define behavior for ZI_Product alias product
persistent table za_product
draft table zd_product
authorization master ( instance )
lock master
total etag LastChangedAt
etag master LastChangedAt
{
  create;
  update;
  delete;

  field ( mandatory ) ProductName;
  field ( readonly, numbering : managed ) ProductUuid;
  field ( readonly ) CreatedBy, CreatedAt, LastChangedBy, LastChangedAt;

  validation validateMandatoryFields on save { field ProductName create; }

  mapping for za_product
    {
      ProductUuid = product_uuid;
      ProductName = product_name;
      ProductType = product_type;
      CreatedBy = created_by;
      CreatedAt = created_at;
      LastChangedBy = last_changed_by;
      LastChangedAt = last_changed_at;
    }

  draft determine action Prepare
  {
    validation validateMandatoryFields;
  }
// The side effect forces the frontend to request the messages (SAP__messages) in OData call
  side effects
  {
    determine action Prepare executed on field ProductName affects messages;
  }
  draft action Edit;
  draft action Activate optimized;
  draft action Discard;
  draft action Resume;

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 09:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178489#M4922696</guid>
      <dc:creator>chrisp_</dc:creator>
      <dc:date>2025-08-12T09:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178585#M4922711</link>
      <description>Nice thank you. Is it possible to determine this side effect on create/save somehow</description>
      <pubDate>Tue, 12 Aug 2025 11:25:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178585#M4922711</guid>
      <dc:creator>a_seibel</dc:creator>
      <dc:date>2025-08-12T11:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178685#M4922722</link>
      <description>Since the PREPARE is executed during initial CREATE and further SAVE, it is handled by the action that creates the state messages. In this case it is the defined validation and here you can control the generation of the messages by adding create, update or both on the field that is used for the validation.</description>
      <pubDate>Tue, 12 Aug 2025 13:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14178685#M4922722</guid>
      <dc:creator>chrisp_</dc:creator>
      <dc:date>2025-08-12T13:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14183928#M4923310</link>
      <description>Hi, any idea to solve this problem? Best Regards.</description>
      <pubDate>Tue, 19 Aug 2025 13:00:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14183928#M4923310</guid>
      <dc:creator>RenatoLima</dc:creator>
      <dc:date>2025-08-19T13:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior validation messages are not displayed</title>
      <link>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14214963#M4926014</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/755478"&gt;@chrisp_&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;do you have any experience how to implement this for validations on child entities?&lt;BR /&gt;&lt;BR /&gt;In my case i want to apply a validation on draft action prepare (only possible on root entity) and mark fields of the 1:n child entity table rows.&lt;BR /&gt;&lt;BR /&gt;It would be much easier if there would be a better documentation with more examples.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 15:23:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/behavior-validation-messages-are-not-displayed/qaa-p/14214963#M4926014</guid>
      <dc:creator>Robert_Schulte</dc:creator>
      <dc:date>2025-09-11T15:23:49Z</dc:date>
    </item>
  </channel>
</rss>

