<?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: SAVE an Instance to Database? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114987#M1617871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually serializable and persistent objects are different things, but Thomas covers both in [this blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1013] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham Robbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Aug 2011 04:19:12 GMT</pubDate>
    <dc:creator>GrahamRobbo</dc:creator>
    <dc:date>2011-08-21T04:19:12Z</dc:date>
    <item>
      <title>SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114982#M1617866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy Guru's,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way to save an instance to database?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 13:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114982#M1617866</guid>
      <dc:creator>swen_hettstedt2</dc:creator>
      <dc:date>2011-08-19T13:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114983#M1617867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please explain a bit more about what you're trying to do and why.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 14:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114983#M1617867</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-08-19T14:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114984#M1617868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step:&lt;/P&gt;&lt;P&gt;We move the process-data to an instance and save an ID to the process and lost the instance.&lt;/P&gt;&lt;P&gt;At this point i want save all process-data and all instances to database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second step.&lt;/P&gt;&lt;P&gt;This step needs the informations from the previous step.&lt;/P&gt;&lt;P&gt;I have an reference to the first step.&lt;/P&gt;&lt;P&gt;And now i want to read all information from the first step into new instance and structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There isn't a time-connection between the step's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope the description is enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Swen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 15:02:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114984#M1617868</guid>
      <dc:creator>swen_hettstedt2</dc:creator>
      <dc:date>2011-08-19T15:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114985#M1617869</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;we still don't have the context, so we're only able to answer directly your question, but I understand that you are talking about a class instance (ABAP objects) : you may serialize your instance to XML, and save it, and reload it later to deserialize it to the instance again. For that, you need to add the interface IF_SERIALIZABLE_OBJECT to the class. And that's all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 16:20:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114985#M1617869</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-08-19T16:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114986#M1617870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answer from radio Eriwan: Basically, yes.Search for &lt;STRONG&gt;&lt;EM&gt;persistent objects&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 22:47:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114986#M1617870</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-08-19T22:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114987#M1617871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually serializable and persistent objects are different things, but Thomas covers both in [this blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1013] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham Robbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Aug 2011 04:19:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114987#M1617871</guid>
      <dc:creator>GrahamRobbo</dc:creator>
      <dc:date>2011-08-21T04:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114988#M1617872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hy together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for answers. the hints were very helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is a little testreport.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZABAP_OO_SERIALIZE_01
*&amp;amp;---------------------------------------------------------------------*
REPORT  zabap_oo_serialize_01.
CLASS a  DEFINITION DEFERRED.
DATA:
      a     TYPE REF TO a,
      a_new TYPE REF TO a,
      serializable_object   TYPE REF TO if_serializable_object,
      serializable_objects  LIKE TABLE OF serializable_object
      .
DATA: ls_serial TYPE zabap_serialize.
DATA: lt_serial TYPE TABLE OF zabap_serialize.

*----------------------------------------------------------------------*
*       INTERFACE if_display_id
*----------------------------------------------------------------------*
INTERFACE if_display_id.
  METHODS:
    display_id.
ENDINTERFACE.                    "if_display_id

*----------------------------------------------------------------------*
*       CLASS a DEFINITION
*----------------------------------------------------------------------*
CLASS a DEFINITION.
  PUBLIC SECTION.
    DATA: mt_sflight TYPE TABLE OF sflight.
    INTERFACES if_serializable_object.
    INTERFACES if_display_id.
    METHODS: constructor
        IMPORTING
          i_id TYPE numc2.
  PRIVATE SECTION.
    DATA: m_id        TYPE numc2.
ENDCLASS.                    "a DEFINITION
*----------------------------------------------------------------------*
*       CLASS a IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS a IMPLEMENTATION.
  METHOD constructor.
    me-&amp;gt;m_id = i_id.
  ENDMETHOD.                    "constructor

  METHOD if_display_id~display_id.
    WRITE: 'ID:', me-&amp;gt;m_id.
    ULINE.
  ENDMETHOD.                    "display_id
ENDCLASS.                    "a IMPLEMENTATION

START-OF-SELECTION.
  CLEAR: lt_serial[].

  CREATE OBJECT a
    EXPORTING
      i_id = 81.

  APPEND:  a TO serializable_objects.

  SELECT * FROM sflight INTO TABLE a-&amp;gt;mt_sflight.

  CLEAR: ls_serial.
  CALL TRANSFORMATION id_indent
     SOURCE obj = a
     RESULT XML ls_serial-xml.

  CALL FUNCTION 'GUID_CREATE'
    IMPORTING
      ev_guid_22 = ls_serial-guid.

  APPEND ls_serial TO lt_serial.

  IF lt_serial[] IS NOT INITIAL.

    TRY .
        INSERT zabap_serialize FROM TABLE lt_serial.

      CATCH cx_sy_open_sql_db.
        WRITE: 'INSERT-Error!'.
        STOP.
    ENDTRY.

  ENDIF.

  CLEAR: lt_serial[].

  SELECT * FROM zabap_serialize INTO TABLE lt_serial.

  LOOP AT lt_serial INTO ls_serial.

    CALL TRANSFORMATION id_indent
    SOURCE XML ls_serial-xml
    RESULT obj = a_new.

    TRY .

        CALL METHOD a_new-&amp;gt;if_display_id~display_id.
      CATCH cx_sy_ref_is_initial.
        WRITE: 'A-NEW-Error!'.
        STOP.

    ENDTRY.
    CLEAR: a_new.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;Added Code tags&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Aug 23, 2011 2:49 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 19:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114988#M1617872</guid>
      <dc:creator>swen_hettstedt2</dc:creator>
      <dc:date>2011-08-22T19:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE an Instance to Database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114989#M1617873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Swen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate your feedback. Wish other OPs will take a hint from it &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2011 09:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-an-instance-to-database/m-p/8114989#M1617873</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-08-23T09:20:56Z</dc:date>
    </item>
  </channel>
</rss>

