<?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: BAPI_OBJCL_CHANGE cannot commit ??? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529192#M1561262</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 was confused with your question. Check whethere some body is editing the current entry. and change your code like this&lt;/P&gt;&lt;P&gt;The user name will be there in the return table. you can identify who is locking the entry. when you are passing WAIT   = 'X'&lt;/P&gt;&lt;P&gt;there will not be any problem. It will be synchronous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
      OBJECTKEY          = LV_OBJECTKEY
      OBJECTTABLE        = 'MCHA'
      CLASSNUM           = 'BATCH_01'
      CLASSTYPE          = '022'
    IMPORTING
      CLASSIF_STATUS     = CLASSIF_STATUS
    TABLES
      ALLOCVALUESNUMNEW  = IT_VALUES_NUM
      ALLOCVALUESCHARNEW = IT_VALUES_CHAR
      ALLOCVALUESCURRNEW = IT_VALUES_CURR
      RETURN             = IT_BAPIRET2.
 
 
  read table IT_BAPIRET2 with key type = 'E' transporting no fields.

   if sy-subrc ne 0.
     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT   = 'X'
      IMPORTING
        RETURN = WA_BAPIRET2.
   ELSE.
      CALL FUNCTION 'C14ALD_BAPIRET2_SHOW'
       TABLES
         I_BAPIRET2_TAB       = IT_BAPIRET2            .
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Dec 2010 14:57:31 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-12-22T14:57:31Z</dc:date>
    <item>
      <title>BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529186#M1561256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
      OBJECTKEY          = LV_OBJECTKEY
      OBJECTTABLE        = 'MCHA'
      CLASSNUM           = 'BATCH_01'
      CLASSTYPE          = '022'
    IMPORTING
      CLASSIF_STATUS     = CLASSIF_STATUS
    TABLES
      ALLOCVALUESNUMNEW  = IT_VALUES_NUM
      ALLOCVALUESCHARNEW = IT_VALUES_CHAR
      ALLOCVALUESCURRNEW = IT_VALUES_CURR
      RETURN             = IT_BAPIRET2.


  IF CLASSIF_STATUS = 1.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT   = 'X'
      IMPORTING
        RETURN = WA_BAPIRET2.

  ELSE.

     CALL FUNCTION 'C14ALD_BAPIRET2_SHOW'
       TABLES
         I_BAPIRET2_TAB       = IT_BAPIRET2
               .
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT_BAPIRET2 return error message:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Object is currently locked by user.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The assigment was not changed&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;currently, no user to change batch's characteristics. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solve this problem??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 13:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529186#M1561256</guid>
      <dc:creator>former_member1137458</dc:creator>
      <dc:date>2010-12-22T13:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529187#M1561257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi cpliu903 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try to put "wait up to..." statement after first fm. It should fix the problem .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Yossi Rozenberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:05:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529187#M1561257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-22T14:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529188#M1561258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should locked by you only. Please check the code , you just execute the bapi and if the classification status is not 1 you are doing something. In the mean time your process is not completed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:11:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529188#M1561258</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-12-22T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529189#M1561259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Goto SM12 and check and delete any locks are present&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:34:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529189#M1561259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-22T14:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529190#M1561260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at MAT_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call -&amp;gt; BAPI_OBJCL_CHANGE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if classification status = 1&lt;/P&gt;&lt;P&gt;        commit.&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;   popup error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is whole flow. please see  the image. that is capture from SM12&lt;/P&gt;&lt;P&gt;[http://img193.imageshack.us/img193/4613/lockyo.png|http://img193.imageshack.us/img193/4613/lockyo.png]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:43:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529190#M1561260</guid>
      <dc:creator>former_member1137458</dc:creator>
      <dc:date>2010-12-22T14:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529191#M1561261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had same problem.&lt;/P&gt;&lt;P&gt;The usual commit work and wait is not enought.&lt;/P&gt;&lt;P&gt;You should add more time for the operation to end it's processes and remove locks.&lt;/P&gt;&lt;P&gt;If you will add wait up to lets say 3 seconds at end of each loop run - you will see if this is the problem.&lt;/P&gt;&lt;P&gt;and then find your own logic to optimize the run time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Yossi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:53:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529191#M1561261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-22T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_OBJCL_CHANGE cannot commit ???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529192#M1561262</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 was confused with your question. Check whethere some body is editing the current entry. and change your code like this&lt;/P&gt;&lt;P&gt;The user name will be there in the return table. you can identify who is locking the entry. when you are passing WAIT   = 'X'&lt;/P&gt;&lt;P&gt;there will not be any problem. It will be synchronous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
      OBJECTKEY          = LV_OBJECTKEY
      OBJECTTABLE        = 'MCHA'
      CLASSNUM           = 'BATCH_01'
      CLASSTYPE          = '022'
    IMPORTING
      CLASSIF_STATUS     = CLASSIF_STATUS
    TABLES
      ALLOCVALUESNUMNEW  = IT_VALUES_NUM
      ALLOCVALUESCHARNEW = IT_VALUES_CHAR
      ALLOCVALUESCURRNEW = IT_VALUES_CURR
      RETURN             = IT_BAPIRET2.
 
 
  read table IT_BAPIRET2 with key type = 'E' transporting no fields.

   if sy-subrc ne 0.
     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT   = 'X'
      IMPORTING
        RETURN = WA_BAPIRET2.
   ELSE.
      CALL FUNCTION 'C14ALD_BAPIRET2_SHOW'
       TABLES
         I_BAPIRET2_TAB       = IT_BAPIRET2            .
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2010 14:57:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-objcl-change-cannot-commit/m-p/7529192#M1561262</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-12-22T14:57:31Z</dc:date>
    </item>
  </channel>
</rss>

