<?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: Update New Field with Persistent Data Objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001103#M1344254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Continued from previous post.....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a sample test program to illustrate the problem. One of the fields on this table, &lt;EM&gt;FANAM&lt;/EM&gt; existed when the table was initially created and the persistent object class was generated and the fields were mapped using the mapper. This get and set methods work perfectly. The new field &lt;EM&gt;PERID&lt;/EM&gt; was added to the table after the persistent class was created and mapped. I went back into the mapper and mapped this field as well. The get and set methods were generated automatically. However when I attempt to update this field using the set method, the field is not updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zzpggah_test_persistent.

DATA: lr_agent     TYPE REF TO zca_openrl_it0021_pers,
      lr_pers_obj  TYPE REF TO zcl_openrl_it0021_pers.

TRY .

    lr_agent    = zca_openrl_it0021_pers=&amp;gt;agent.
    lr_pers_obj = lr_agent-&amp;gt;get_persistent(
                    i_begda    = '20090101'
                    i_endda    = '99991231'
                    i_famsa    = '1'
                    i_infty    = '0021'
                    i_objps    = ''
                    i_pernr    = 13
                    i_zzloadid = '20090006' ).

  CATCH cx_os_object_not_found.

ENDTRY.

lr_pers_obj-&amp;gt;set_fanam( 'AAAAAAA' ).
lr_pers_obj-&amp;gt;set_perid( '123456789' ).
COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So using this sample program I field &lt;EM&gt;FANAM&lt;/EM&gt; is updated, but &lt;EM&gt;PERID&lt;/EM&gt; is not. No errors or exceptions are raised when running this code. If you have any ideas, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gregg Hinkle on Aug 24, 2009 8:44 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gregg Hinkle on Aug 24, 2009 8:46 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Aug 2009 13:43:39 GMT</pubDate>
    <dc:creator>GreggHinkle</dc:creator>
    <dc:date>2009-08-24T13:43:39Z</dc:date>
    <item>
      <title>Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001100#M1344251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which I previously created a persistent object class, generated my base and agent classes and mapped the fields using the persistent data mapper. Everything worked great and I can read and update the records from this table using the get and set methods perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A new requirement came in recently and I needed to add an additional field to this table. So I appended the new field to the end of the table (saved and activated changes) and then I went back to my persistent object class and using the persistent data mapper, added the new field. (saved and activated). The new set and get methods were generated for the new field. However when I call the get_persistent method to get the persistent data object, and then use the get method to view the new field, the contents are empty even though the table contains data in this field. When I use the set method to update the new field, nothing is written to the database. All the other get and set methods for the other fields still work perfectly. Has anyone come across this before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 22:00:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001100#M1344251</guid>
      <dc:creator>GreggHinkle</dc:creator>
      <dc:date>2009-08-21T22:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001101#M1344252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please give us the code of set and get method so that it becomes easier to analyze ur issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2009 01:42:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001101#M1344252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-22T01:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001102#M1344253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siddarth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for responding. The get and set methods that are used are the SAP generated get and set methods that are created when you use the persistent data mapper. Following is the generated get and set methods:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The SAP generated Get method&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method GET_PERID.
***BUILD 051401
     " returning RESULT
     " raising CX_OS_OBJECT_NOT_FOUND
************************************************************************
* Purpose        : Get Attribute PERID
*
* Version        : 2.0
*
* Precondition   : -
*
* Postcondition  : The object state is loaded, result is set
*
* OO Exceptions  : CX_OS_OBJECT_NOT_FOUND
*
* Implementation : -
*
************************************************************************
* Changelog:
* - 2000-03-14   : (BGR) Version 2.0
* - 2000-07-28   : (SB)  OO Exceptions
************************************************************************

* * Inform class agent and handle exceptions
  state_read_access.

  result = PERID.

           " GET_PERID
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The SAP generated Set method&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method SET_PERID.
***BUILD 051401
     " importing I_PERID
     " raising CX_OS_OBJECT_NOT_FOUND
************************************************************************
* Purpose        : Set attribute PERID
*
* Version        : 2.0
*
* Precondition   : -
*
* Postcondition  : The object state is loaded, attribute is set
*
* OO Exceptions  : CX_OS_OBJECT_NOT_FOUND
*
* Implementation : -
*
************************************************************************
* Changelog:
* - 2000-03-14   : (BGR) Version 2.0
* - 2000-07-28   : (SB)  OO Exceptions
* - 2000-10-04   : (SB)  Namespaces
************************************************************************

* * Inform class agent and handle exceptions
  state_write_access.

  if ( I_PERID &amp;lt;&amp;gt; PERID ).

    PERID = I_PERID.

*   * Inform class agent and handle exceptions
    state_changed.

  endif. "( I_PERID &amp;lt;&amp;gt; PERID )

           " GET_PERID
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gregg Hinkle on Aug 24, 2009 8:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 12:50:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001102#M1344253</guid>
      <dc:creator>GreggHinkle</dc:creator>
      <dc:date>2009-08-24T12:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001103#M1344254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Continued from previous post.....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a sample test program to illustrate the problem. One of the fields on this table, &lt;EM&gt;FANAM&lt;/EM&gt; existed when the table was initially created and the persistent object class was generated and the fields were mapped using the mapper. This get and set methods work perfectly. The new field &lt;EM&gt;PERID&lt;/EM&gt; was added to the table after the persistent class was created and mapped. I went back into the mapper and mapped this field as well. The get and set methods were generated automatically. However when I attempt to update this field using the set method, the field is not updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zzpggah_test_persistent.

DATA: lr_agent     TYPE REF TO zca_openrl_it0021_pers,
      lr_pers_obj  TYPE REF TO zcl_openrl_it0021_pers.

TRY .

    lr_agent    = zca_openrl_it0021_pers=&amp;gt;agent.
    lr_pers_obj = lr_agent-&amp;gt;get_persistent(
                    i_begda    = '20090101'
                    i_endda    = '99991231'
                    i_famsa    = '1'
                    i_infty    = '0021'
                    i_objps    = ''
                    i_pernr    = 13
                    i_zzloadid = '20090006' ).

  CATCH cx_os_object_not_found.

ENDTRY.

lr_pers_obj-&amp;gt;set_fanam( 'AAAAAAA' ).
lr_pers_obj-&amp;gt;set_perid( '123456789' ).
COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So using this sample program I field &lt;EM&gt;FANAM&lt;/EM&gt; is updated, but &lt;EM&gt;PERID&lt;/EM&gt; is not. No errors or exceptions are raised when running this code. If you have any ideas, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gregg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gregg Hinkle on Aug 24, 2009 8:44 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gregg Hinkle on Aug 24, 2009 8:46 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 13:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001103#M1344254</guid>
      <dc:creator>GreggHinkle</dc:creator>
      <dc:date>2009-08-24T13:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001104#M1344255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved my own issue. For whatever reason when I mapped the new field using the mapping tool, the ZCB_* class did not regenerate the MAP_* methods. Therefore the data in the field was never updated or read. What I did to fix it was run the Option Utilities - Generate - Class Agent - Class from the mapping screen. This regenerated the agent classes with the new field added. I hope this helps others with the same issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 18:09:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001104#M1344255</guid>
      <dc:creator>GreggHinkle</dc:creator>
      <dc:date>2009-08-24T18:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update New Field with Persistent Data Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001105#M1344256</link>
      <description>&lt;P&gt;Hey Gregg, &lt;/P&gt;&lt;P&gt;thank you very much for your help!&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 09:42:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-new-field-with-persistent-data-objects/m-p/6001105#M1344256</guid>
      <dc:creator>florian_pichler</dc:creator>
      <dc:date>2021-10-07T09:42:22Z</dc:date>
    </item>
  </channel>
</rss>

