<?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: Error when creating Entity from draft in RAP / OData4 in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/12779602#M4797933</link>
    <description>&lt;P&gt;Hi Mattias,&lt;/P&gt;&lt;P&gt;try and switch your total etag and etag master fields in your BDEF.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;total etag LastChangedAt
etag master LocalLastChangedAt&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Perhaps this link can explain more? &lt;A href="https://help.sap.com/docs/abap-cloud/abap-rap/total-etag"&gt;https://help.sap.com/docs/abap-cloud/abap-rap/total-etag&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Jessie&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 09:51:32 GMT</pubDate>
    <dc:creator>JessieCheah</dc:creator>
    <dc:date>2023-12-14T09:51:32Z</dc:date>
    <item>
      <title>Error when creating Entity from draft in RAP / OData4</title>
      <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaq-p/12779601</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Hello,&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I'm trying to use a managed RAP to update a custom z-table. I can create the draft, but when I try to create a real active entity I get concurrency errors. I get the same error both when I try to preview my Service Binding and when calling from a "real" fiori elements application. &lt;BR /&gt;&lt;BR /&gt;I'm sure I've missed some detail, but what? I've tried following both blogs and help.sap.com. See details below.&lt;BR /&gt;&lt;BR /&gt;Thanks Mattias&lt;/P&gt;
  &lt;P&gt;The error in the log is&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;State of entity CDS~ZI_CAZZ_AWS_PARAMETERS with key EF8959C642E81EDEA69CFEA0135A81FF was already changed (stale If-Match)&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I have defined both master etag and local etag in the behaviour definition&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;define behavior for ZI_CAZZ_AWS_PARAMETERS alias Parameters&amp;lt;br&amp;gt;persistent table zcazz_aws_param


draft table zcazz_aws_paramd
lock master
total etag LocalLastChangedAt
etag master LastChangedAt
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;{&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;mapping for zcazz_aws_param&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;{&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;CreatedAt = created_at;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;CreatedBy = created_by;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;LastChangedAt = last_changed_at;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;LocalLastChangedAt = local_last_changed_at;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Name = name;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Uuid = uuid;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;field ( readonly, numbering : managed ) Uuid;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;field ( readonly ) CreatedAt, CreatedBy, LastChangedAt, LastChangedBy;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;action copyParameter;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;create;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;update;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;delete;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;}&lt;/P&gt; 
  &lt;P&gt;and in the data definition&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@Semantics.systemDateTime.lastChangedAt: true  
last_changed_at as LastChangedAt,

@Semantics.systemDateTime.localInstanceLastChangedAt: true     
local_last_changed_at as LocalLastChangedAt&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The Fields are of the type Timestmp&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;last_changed_at       : timestampl;
local_last_changed_at : timestampl;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2023 10:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaq-p/12779601</guid>
      <dc:creator>Mattias</dc:creator>
      <dc:date>2023-12-13T10:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating Entity from draft in RAP / OData4</title>
      <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/12779602#M4797933</link>
      <description>&lt;P&gt;Hi Mattias,&lt;/P&gt;&lt;P&gt;try and switch your total etag and etag master fields in your BDEF.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;total etag LastChangedAt
etag master LocalLastChangedAt&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Perhaps this link can explain more? &lt;A href="https://help.sap.com/docs/abap-cloud/abap-rap/total-etag"&gt;https://help.sap.com/docs/abap-cloud/abap-rap/total-etag&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Jessie&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 09:51:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/12779602#M4797933</guid>
      <dc:creator>JessieCheah</dc:creator>
      <dc:date>2023-12-14T09:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating Entity from draft in RAP / OData4</title>
      <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/12779603#M4797934</link>
      <description>&lt;P&gt;Hello Jessie,&lt;BR /&gt;&lt;BR /&gt;Thank you for your answer. I did that, and also added the fields LocalLastChangedBy to my db table. But the result is the same&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;define behavior for ZI_CAZZ_AWS_PARAMETERS alias Parameters

persistent table zcazz_aws_param
draft table zcazz_aws_paramd
etag master LocalLastChangedAt
lock master total etag LastChangedAt
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried generating a similar app, with the same DB Structure in ABAP Cloud, and there it works. I'm not sure if theversion makes any difference, we're on S/4 2020.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 10:35:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/12779603#M4797934</guid>
      <dc:creator>Mattias</dc:creator>
      <dc:date>2023-12-14T10:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating Entity from draft in RAP / OData4</title>
      <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/13721951#M4831940</link>
      <description>Hi JessieCheah , I am using RAP Managed / OData2 and we are on rise , I am consistently getting error 412 described as bove , when I hit the enter key , I can see on the network this comes after POST Prepare request, but at that stage I do not need this POST Prepare to be submitted yet I have posted a validation for the field only</description>
      <pubDate>Wed, 05 Jun 2024 11:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/13721951#M4831940</guid>
      <dc:creator>mafikalukhele</dc:creator>
      <dc:date>2024-06-05T11:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error when creating Entity from draft in RAP / OData4</title>
      <link>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/13722144#M4831967</link>
      <description>Hi , just for update I added update prechecks and the issue with error 412 was resolved</description>
      <pubDate>Wed, 05 Jun 2024 14:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-when-creating-entity-from-draft-in-rap-odata4/qaa-p/13722144#M4831967</guid>
      <dc:creator>mafikalukhele</dc:creator>
      <dc:date>2024-06-05T14:19:30Z</dc:date>
    </item>
  </channel>
</rss>

