<?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 Object Oriented Transaction Mode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-transaction-mode/m-p/5599114#M1276087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible when using the object oriented transaction mode (for example in a separate method), to avoid the commit work in the calling report? Even there is a rollback work, the commit is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ztest.

data: l_test type ztest.
data: lo_ootrans type ref to ztest2.

select max(id)
from ztest
where l_test-id.
l_test-id = l_test-id + 1.

insert ztest from l_test.

create object lo_ootrans.
call method lo_ootrans-&amp;gt;create.
rollback work.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code of method create is following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

method CONSTRUCTOR.

CL_OS_SYSTEM=&amp;gt;INIT_AND_SET_MODES(
                                  I_EXTERNAL_COMMIT = OSCON_FALSE
                                i_update_mode = OSCON_DMODE_UPDATE_TASK ).

endmethod.

method CREATE.

data: TM type ref to IF_OS_TRANSACTION_MANAGER,
        T  type ref to IF_OS_TRANSACTION.
data l_test type SPFLI.
data: AGENT      type ref to CA_SPFLI_PERSISTENT,
        CONNECTION type ref to CL_SPFLI_PERSISTENT.
data: EXC type ref to CX_ROOT,
        TEXT type STRING.

  TM = CL_OS_SYSTEM=&amp;gt;GET_TRANSACTION_MANAGER( ).
  T  = TM-&amp;gt;CREATE_TRANSACTION( ).

  l_test-CARRID     = 'XY'.
  l_test-CONNID     = '123'.

  AGENT = CA_TEST_PERSISTENT=&amp;gt;AGENT.

  try.

      T-&amp;gt;START( ).

      CONNECTION = AGENT-&amp;gt;GET_PERSISTENT( I_CARRID = l_test-CARRID
                                         I_CONNID = l_test-CONNID ).
      l_test-DEPTIME = CONNECTION-&amp;gt;GET_DEPTIME( ).
      l_test-ARRTIME = CONNECTION-&amp;gt;GET_ARRTIME( ).
      l_test-DEPTIME = WA_SPFLI-DEPTIME - 3600.
      l_test-ARRTIME = WA_SPFLI-ARRTIME - 3600.
      CONNECTION-&amp;gt;SET_DEPTIME( l_test-DEPTIME ).
      CONNECTION-&amp;gt;SET_ARRTIME( l_test-ARRTIME ).

      T-&amp;gt;END( ).

    catch CX_ROOT into EXC.

      TEXT = EXC-&amp;gt;GET_TEXT( ).
      message TEXT type 'I'.

  endtry.

endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the rollback work in the report the insert to table ztest is done. Can this commit to table ztest be avoided?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx for your help,&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 May 2009 21:43:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-05T21:43:53Z</dc:date>
    <item>
      <title>Object Oriented Transaction Mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-transaction-mode/m-p/5599114#M1276087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible when using the object oriented transaction mode (for example in a separate method), to avoid the commit work in the calling report? Even there is a rollback work, the commit is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ztest.

data: l_test type ztest.
data: lo_ootrans type ref to ztest2.

select max(id)
from ztest
where l_test-id.
l_test-id = l_test-id + 1.

insert ztest from l_test.

create object lo_ootrans.
call method lo_ootrans-&amp;gt;create.
rollback work.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code of method create is following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

method CONSTRUCTOR.

CL_OS_SYSTEM=&amp;gt;INIT_AND_SET_MODES(
                                  I_EXTERNAL_COMMIT = OSCON_FALSE
                                i_update_mode = OSCON_DMODE_UPDATE_TASK ).

endmethod.

method CREATE.

data: TM type ref to IF_OS_TRANSACTION_MANAGER,
        T  type ref to IF_OS_TRANSACTION.
data l_test type SPFLI.
data: AGENT      type ref to CA_SPFLI_PERSISTENT,
        CONNECTION type ref to CL_SPFLI_PERSISTENT.
data: EXC type ref to CX_ROOT,
        TEXT type STRING.

  TM = CL_OS_SYSTEM=&amp;gt;GET_TRANSACTION_MANAGER( ).
  T  = TM-&amp;gt;CREATE_TRANSACTION( ).

  l_test-CARRID     = 'XY'.
  l_test-CONNID     = '123'.

  AGENT = CA_TEST_PERSISTENT=&amp;gt;AGENT.

  try.

      T-&amp;gt;START( ).

      CONNECTION = AGENT-&amp;gt;GET_PERSISTENT( I_CARRID = l_test-CARRID
                                         I_CONNID = l_test-CONNID ).
      l_test-DEPTIME = CONNECTION-&amp;gt;GET_DEPTIME( ).
      l_test-ARRTIME = CONNECTION-&amp;gt;GET_ARRTIME( ).
      l_test-DEPTIME = WA_SPFLI-DEPTIME - 3600.
      l_test-ARRTIME = WA_SPFLI-ARRTIME - 3600.
      CONNECTION-&amp;gt;SET_DEPTIME( l_test-DEPTIME ).
      CONNECTION-&amp;gt;SET_ARRTIME( l_test-ARRTIME ).

      T-&amp;gt;END( ).

    catch CX_ROOT into EXC.

      TEXT = EXC-&amp;gt;GET_TEXT( ).
      message TEXT type 'I'.

  endtry.

endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the rollback work in the report the insert to table ztest is done. Can this commit to table ztest be avoided?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx for your help,&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:43:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-transaction-mode/m-p/5599114#M1276087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T21:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Object Oriented Transaction Mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-transaction-mode/m-p/5599115#M1276088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;problem was solved otherwise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2009 12:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-oriented-transaction-mode/m-p/5599115#M1276088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-12T12:00:23Z</dc:date>
    </item>
  </channel>
</rss>

