<?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>topic Re: Persistence Class causes Excpetion when commiting work in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363472#M1993278</link>
    <description>&lt;P&gt;The short dump indicates an error with UPDATE. The only reason I am aware of is that it leads to breaking a unique key constraint. In debug, what do you see in DB_UTB_ZTESTTABLE, and what contains the database table?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 12:53:04 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-02-24T12:53:04Z</dc:date>
    <item>
      <title>Persistence Class causes Excpetion when commiting work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363471#M1993277</link>
      <description>&lt;P&gt;Hello folks,&lt;BR /&gt;today I tried to implement my first persistence class.&lt;BR /&gt;Reading data from the database works flawlessly but updating rows is not working.&lt;BR /&gt;After using the set_attribute method of the persistence object I immediately commit the work&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;lo_persistence-&amp;gt;set_creation_date( i_creation_date = sy-datlo ).
COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But unfortunately I get an CX_OS_DB_UPDATE exception.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;--------Error--------
"UNCAUGHT_EXCEPTION" CX_OS_DB_UPDATE
"ZCB_ZTESTMFSERIALIZE=====CP" bzw. ZCB_ZTESTMFSERIALIZE=====CM00F
"MAP_SAVE_TO_DATABASE"
--------Environment-------- SAP kernel....... 742
 Created on....... Nov 26 2014 20:36:14
 Created at....... Linux GNU SLES-11 x86_64 cc4.3.4 use-pr141031
 Database version Sybase ASE 15.7.0.1300
 Patch level....... 28
 Patch text.......
 Database............. 15.7
 SAP database version. 742
 Operating system... Linux 2.6, Linux 3

--------Info on where terminated--------
The termination occurred in ABAP program "ZCB_ZTESTMFSERIALIZE=====CP",
 in "MAP_SAVE_TO_DATABASE". The main program
was "RSM13000".
In the source code, the termination point is in line 169 of (Include)
program "ZCB_ZTESTMFSERIALIZE=====CM00F".
The program "ZCB_ZTESTMFSERIALIZE=====CP" was started in the update
 system.

--------Source code extract--------
 166 * * DB Updates
 167   update ZTESTTABLE FROM TABLE DB_UTB_ZTESTTABLE.
 168   if SY-SUBRC &amp;lt;&amp;gt; 0.
&amp;gt;&amp;gt;&amp;gt;&amp;gt;     raise exception type CX_OS_DB_UPDATE
 170       exporting
 171         TABLE = 'ZTESTTABLE'.
 172   endif.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Here are some class information:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1892998-tutzk.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1892997-qdtd6.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Friends: ZCB_ZTESTMFSERIALIZE&lt;BR /&gt;persistence mapping was simply adding all available fields and using defaults. &lt;BR /&gt;When activating the class I accept creating the managing class.&lt;/P&gt;
  &lt;P&gt;I did not find any help in the knowledge base or in any google search results.&lt;BR /&gt;I hope you can help me. &lt;BR /&gt;Please ask if you have further questions&lt;BR /&gt;&lt;BR /&gt;Thank you very much and kind regards!&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 10:44:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363471#M1993277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-02-24T10:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence Class causes Excpetion when commiting work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363472#M1993278</link>
      <description>&lt;P&gt;The short dump indicates an error with UPDATE. The only reason I am aware of is that it leads to breaking a unique key constraint. In debug, what do you see in DB_UTB_ZTESTTABLE, and what contains the database table?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 12:53:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363472#M1993278</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-02-24T12:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Persistence Class causes Excpetion when commiting work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363473#M1993279</link>
      <description>&lt;P&gt;Helllo Sandra,&lt;BR /&gt;thanks for your reply. &lt;BR /&gt;Checking the DB_UTB_ZTESTTABLE gave me the problem, but unfortunately not the answer.&lt;BR /&gt;My table contains the field "CLIENT" of type "MANDT" which is, in this case, not used to differ between our system but to safe from which client the information came. &lt;BR /&gt;In my persistence - table mapping within the CL_CLASS I am not able to map the "CLIENT" field. So it does not contain the field as attribute, and it is not given to the DB_UTB_ZTTESTTABLE. But "CLIENT" is part of the primary key and as I want to update the record it does not find any matching in the database table.  &lt;/P&gt;&lt;P&gt;So I need to know how to add the client field to the persistence - table mapping within my CL_CLASS.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" style="font-size: 15px; color: rgb(51, 51, 51);" /&gt;My key mapping in the CL_Class is complete.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" style="font-size: 15px; display: block; color: rgb(60, 60, 60);" /&gt;&lt;IMG alt="" style="font-size: 14px; display: block;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1898460-persistence.png" /&gt;&lt;/P&gt;&lt;P&gt;The CLIENT field is not available to add to the mapping:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1898461-fieldmap.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 07:07:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/persistence-class-causes-excpetion-when-commiting-work/m-p/12363473#M1993279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-02-25T07:07:03Z</dc:date>
    </item>
  </channel>
</rss>

