<?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: RAP: Draft do not transfer keyvalue into DB-Table in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/rap-draft-do-not-transfer-keyvalue-into-db-table/qaa-p/13975736#M4897802</link>
    <description>&lt;P&gt;after checking my behavior def i've found the reason for my case:&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;...
 mapping for /nnn/chckmsgcfg corresponding;
...&lt;/LI-CODE&gt;&lt;P&gt;If the field-definition in the db-table is different to the data definitions, the transfer of values doenst not work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":see_no_evil_monkey:"&gt;🙈&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 08:56:25 GMT</pubDate>
    <dc:creator>adazip</dc:creator>
    <dc:date>2025-01-03T08:56:25Z</dc:date>
    <item>
      <title>RAP: Draft do not transfer keyvalue into DB-Table</title>
      <link>https://community.sap.com/t5/technology-q-a/rap-draft-do-not-transfer-keyvalue-into-db-table/qaq-p/13975391</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;i'am a beginner in RAP and I have the little curisously problem:&lt;/P&gt;&lt;P&gt;I have an managed application in which I want to enter values like&amp;nbsp; /DMO/TEST or only TEST as a key value in a table. The application includes 5 Tables, and 3 works fine, but only two doesn't work correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;define table /***/chcklink {

  key client         : abap.clnt not null;
  @AbapCatalog.foreignKey.screenCheck : false
  key modul          : /***/dt_modul not null
    with foreign key /**/chcksmod
      where client = /***/chcklink.client
        and modul = /***/chcklink.modul;
  key check_appl     : abap.char(12) not null;
  active             : abap_boolean;
... }

define table /***/chcklink_d {

  key client         : abap.clnt not null;
  key modul          : /***/dt_pbs_modul not null;
  key checkappl      : abap.char(12) not null;
  active             : abap_boolean;
...}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This table is a child of the main-view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When creating a new data record, everything works fine, the values are available as&amp;nbsp; key or simple table-value in the draft table and it will show on the screen correctly. However, if I save it, the values are no longer transferred to the persistent table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: in this case the key-value will be not trafnserfed. in an another case, one of 5 fields will be not tranfsered !?&lt;BR /&gt;Draft (create new entry):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adazip_0-1735838735086.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/206982iBDF359D37DF9551A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adazip_0-1735838735086.png" alt="adazip_0-1735838735086.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;/DMO/Test is the key-value. Its definied mandatory.&lt;/P&gt;&lt;P&gt;Values in draft-table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adazip_1-1735838761940.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/206983i6CD5F1297F21F660/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adazip_1-1735838761940.png" alt="adazip_1-1735838761940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; now apply new associated entry&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adazip_2-1735838809947.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/206984i027846C85B83AFA0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adazip_2-1735838809947.png" alt="adazip_2-1735838809947.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the main-screen the new entry is visible, but the main-screen is still in edit-mode.&lt;/P&gt;&lt;P&gt;--&amp;gt;saving the main view / main object&lt;/P&gt;&lt;P&gt;Screen is changing from editable mode to readonly mode, and the new created Entry in the subtable disappears.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adazip_3-1735838886114.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/206985i4F90F22DFC41691E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adazip_3-1735838886114.png" alt="adazip_3-1735838886114.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in the corresponging main-db-table is a new entry, without keyvalue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adazip_4-1735838900155.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/206986i7AAEDEB8A3030039/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adazip_4-1735838900155.png" alt="adazip_4-1735838900155.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When i try to create a new entry, it will&amp;nbsp; produce a shortdump, cause dupplicate key (empty value as a key-value already exists )&lt;/P&gt;&lt;P&gt;All associated tables are definied simliar, but only this one doesn't work.&lt;/P&gt;&lt;P&gt;My question is now : Could someone tell me whats wrong ?&lt;/P&gt;&lt;P&gt;I've tried with an uuid and the missing field as a non-key-field, but without a solution.&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;&lt;P&gt;Adalbert&lt;/P&gt;&lt;P&gt;codings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;BHEV:
managed implementation in class /nnn/BP_R_CHCKSMOD unique;
strict ( 2 );
//strict;
with draft;

define behavior for /nnn/R_CHCKSMOD alias SMOD
//implementation in class /nnn/BP_R_CHCKSMOD unique
persistent table /nnn/chcksmod
draft table /nnn/chcksm000_d

lock master total etag Lastchangedat
etag master Lastchangedat

authorization master ( global, instance )
//authorization master ( instance )
{
  create ( precheck );
  update ( precheck );
  delete;

  draft action Edit ;
  draft action Activate optimized;
  draft action Discard;
  draft action Resume;
  draft determine action Prepare;

  field ( mandatory : create ) Modul;
  field ( readonly : update ) Modul;

  association _CHCKLINK { create ( features : instance ); with draft; }
...
}//********************************************************************************
define behavior for /nnn/R_CHCKLINK alias CHCKLINK
persistent table /nnn/chcklink
draft table /nnn/chcklink_d
lock dependent by _smod
authorization dependent by _smod
etag master Locallastchangedat
{
  update ( precheck );
  delete;

  association _smod { with draft; }

  field ( readonly  ) Modul;
  field ( mandatory : create ) CheckAppl;
  field ( readonly : update ) CheckAppl;

  mapping for /nnn/chcklink corresponding;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 08:33:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rap-draft-do-not-transfer-keyvalue-into-db-table/qaq-p/13975391</guid>
      <dc:creator>adazip</dc:creator>
      <dc:date>2025-01-03T08:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: RAP: Draft do not transfer keyvalue into DB-Table</title>
      <link>https://community.sap.com/t5/technology-q-a/rap-draft-do-not-transfer-keyvalue-into-db-table/qaa-p/13975736#M4897802</link>
      <description>&lt;P&gt;after checking my behavior def i've found the reason for my case:&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;...
 mapping for /nnn/chckmsgcfg corresponding;
...&lt;/LI-CODE&gt;&lt;P&gt;If the field-definition in the db-table is different to the data definitions, the transfer of values doenst not work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":see_no_evil_monkey:"&gt;🙈&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 08:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rap-draft-do-not-transfer-keyvalue-into-db-table/qaa-p/13975736#M4897802</guid>
      <dc:creator>adazip</dc:creator>
      <dc:date>2025-01-03T08:56:25Z</dc:date>
    </item>
  </channel>
</rss>

