<?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 does not return updated value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270295#M1987758</link>
    <description>&lt;P&gt;Hello Dominik, &lt;/P&gt;&lt;P&gt;this is a good hint, by resetting the buffer op the function group, i got the right value. Thank you very much for your response.&lt;/P&gt;&lt;P&gt;Best regard,&lt;/P&gt;&lt;P&gt;Ton&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jan 2021 20:31:35 GMT</pubDate>
    <dc:creator>former_member595421</dc:creator>
    <dc:date>2021-01-30T20:31:35Z</dc:date>
    <item>
      <title>BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270291#M1987754</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;
  &lt;P&gt;i have created a ALV Report to display Equipment data and a button in toolbar, with which you can jump off in transaction&lt;STRONG&gt; IE02&lt;/STRONG&gt; and change equipment master. After user &lt;STRONG&gt;Save&lt;/STRONG&gt; in &lt;STRONG&gt;IE02&lt;/STRONG&gt; press and come back to report, i use BAPI to read Equiment Data again but i get old value instead of new value updated in I&lt;STRONG&gt;E02&lt;/STRONG&gt;.&lt;/P&gt;
  &lt;P&gt;I have tried all options from &lt;STRONG&gt;CALL TRANSACTION&lt;/STRONG&gt; with &lt;STRONG&gt;MODE&lt;/STRONG&gt; and &lt;STRONG&gt;UPDATE&lt;/STRONG&gt;, I also used the bapi &lt;STRONG&gt;BAPI_TRANSACTION_COMMIT&lt;/STRONG&gt; after &lt;STRONG&gt;CALL TRANSACTION&lt;/STRONG&gt; but still get the old value.&lt;/P&gt;
  &lt;P&gt; Only when i quit the current session and start the report again, so i get the correct data. By selecting data in DB, the updated data are saved in DB.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  TRY.
      CALL TRANSACTION 'IE02' WITH AUTHORITY-CHECK and SKIP FIRST SCREEN. "USING lt_bdc MODE 'A' UPDATE 'A' MESSAGES INTO lt_mess. "and SKIP FIRST SCREEN.
    CATCH cx_sy_authorization_error.
      RETURN.
  ENDTRY.
  
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = 'X'
* IMPORTING
*   RETURN        =
          .
  
  DATA:
        lv_CUOBJ TYPE CUOBJ,
        lt_kssk TYPE TABLE OF kssk,
        lv_obj    TYPE bapi1003_key-object,
        lv_kssk_obj TYPE bapi1003_key-object,
        lt_alloc  TYPE TABLE OF bapi1003_alloc_list,
        lt_return  TYPE TABLE OF  bapiret2.



  lv_obj = &amp;lt;fs&amp;gt;. " &amp;lt;------ EQUNR

  SELECT SINGLE CUOBJ FROM inob INTO lv_CUOBJ WHERE objek eq lv_obj and obtab eq 'EQUI' AND klart eq '002'.

  SELECT * FROM kssk INTO CORRESPONDING FIELDS OF TABLE lt_kssk WHERE objek eq lv_CUOBJ.


  CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
    EXPORTING
      objectkey_imp   = lv_obj
      objecttable_imp = 'EQUI'
      classtype_imp   = '002'
     READ_VALUATIONS = 'X'
*      keydate         = sy-datum
*      language        = sy-langu
*     OBJECTKEY_IMP_LONG       =
    TABLES
      alloclist       = lt_alloc
*     ALLOCVALUESCHAR =
*     ALLOCVALUESCURR =
*     ALLOCVALUESNUM  =
      return          = lt_return.
*&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;From Code above, table&lt;STRONG&gt; lt_kssk&lt;/STRONG&gt; and table &lt;STRONG&gt;lt_alloc&lt;/STRONG&gt; are always different. The data in table &lt;STRONG&gt;lt_kssk &lt;/STRONG&gt;are always correct (select data directly from DB) and the data in &lt;STRONG&gt;lt_alloc &lt;/STRONG&gt;not ( read data through BAPI).&lt;/P&gt;
  &lt;P&gt;By debugging i found out, that the data is buffered in Function Group of this BAPI somehow. My question is, is there any way to reset the buffer or how can i work around with this.&lt;/P&gt;
  &lt;P&gt;It happens with all BAPIs: &lt;STRONG&gt;BAPI_OBJCL_GETCLASSES&lt;/STRONG&gt;, &lt;STRONG&gt;BAPI_EQUI_GETSTATUS &lt;/STRONG&gt;etc..&lt;/P&gt;
  &lt;P&gt;I appreciate any help.&lt;/P&gt;
  &lt;P&gt;Thanks and regards,&lt;/P&gt;
  &lt;P&gt;Ton&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:52:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270291#M1987754</guid>
      <dc:creator>former_member595421</dc:creator>
      <dc:date>2020-12-10T11:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270292#M1987755</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;pis296&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When you call a transaction using CALL TRANSACTION ... AND SKIP FIRST SCREEN you don't have a control on data update processing. Typically SAP updates the data asynchronously with update tasks. Therefore once you get out of the transaction and try to read the data, in fact the data is not changed in the database yet. BAPI_TRANSACTION_COMMIT won't help you here.&lt;/P&gt;&lt;P&gt;Instead you may want to call IE02 with CALL TRANSACTION ... USING ... MODE 'E' UPDATE 'S'. This way the data update is synchronous and once you are out of the transaction and back to your program all the changes are already written to the database. So you can read all the updated data.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dominik Tylczynski&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 12:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270292#M1987755</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2020-12-10T12:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270293#M1987756</link>
      <description>&lt;P&gt;Hello Dominik,&lt;/P&gt;&lt;P&gt;thank you for your quick response. As i mentioned above, i have tried all options of CALL TRANSACTION ( all combination of MODE and UPDATE), i still got the old value. After CALL TRANSACTION command i have tried to select data from Database and the updated value is saved (with 2 &lt;STRONG&gt;Select&lt;/STRONG&gt; from code). Its somehow weird and im still searching for answer. Any idea?&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Ton&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 12:47:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270293#M1987756</guid>
      <dc:creator>former_member595421</dc:creator>
      <dc:date>2020-12-10T12:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270294#M1987757</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;pis296&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now I understand you problem better. I must have overlooked the fact that you've already check UPDATE option of CALL TRANSACTION.&lt;/P&gt;&lt;P&gt;BAPI_OBJCL_GETCLASSES uses CLAP_DDB_* functions internally. They indeed use buffering. The function CLAP_DDB_INIT_CLASSIFICATION initializes all the buffers of the function group.&lt;/P&gt;&lt;P&gt;Also look at the note &lt;A href="https://launchpad.support.sap.com/#/notes/0000438353" target="_blank"&gt;438353 - ObjectClassification.GetClasses: Initialization&lt;/A&gt; that also refers to function CLAP_DDB_INIT_CLASSIFICATION.&lt;/P&gt;&lt;P&gt;Try calling CLAP_DDB_INIT_CLASSIFICATION before BAPI_OBJCL_GETCLASSES&lt;/P&gt;&lt;P&gt;HTH / BR&lt;/P&gt;&lt;P&gt;Dominik Tylczynski&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 13:33:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270294#M1987757</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2020-12-10T13:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270295#M1987758</link>
      <description>&lt;P&gt;Hello Dominik, &lt;/P&gt;&lt;P&gt;this is a good hint, by resetting the buffer op the function group, i got the right value. Thank you very much for your response.&lt;/P&gt;&lt;P&gt;Best regard,&lt;/P&gt;&lt;P&gt;Ton&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 20:31:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270295#M1987758</guid>
      <dc:creator>former_member595421</dc:creator>
      <dc:date>2021-01-30T20:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270296#M1987759</link>
      <description>&lt;P&gt;Isn't CLAP_DDB_INIT_CLASSIFICATION always called by BAPI_OBJCL_GETCLASSES since note 438353?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 09:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270296#M1987759</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-31T09:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI does not return updated value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270297#M1987760</link>
      <description>&lt;A href="https://answers.sap.com/users/1091/sandra.rossi.html"&gt;Sandra Rossi&lt;/A&gt; the note 438353 actually removes CLAP_DDB_INIT_CLASSIFICATION from classification BAPIs.</description>
      <pubDate>Mon, 01 Feb 2021 09:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-does-not-return-updated-value/m-p/12270297#M1987760</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2021-02-01T09:46:31Z</dc:date>
    </item>
  </channel>
</rss>

