<?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: Can we use BAPI inside Customer Exits or BADIs? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579117#M2009185</link>
    <description>&lt;P&gt;Hi Dominik,&lt;/P&gt;&lt;P&gt;I created RFC to update BP and added BAPI_TRANSACTION_COMMIT in it after BP update BAPI. Called RFC as below inside BAPI but it seems it does not consider BAPI_TRANSACTION_COMMIT added in the RFC. Commit happens only when it receives commit outside RFC..&lt;/P&gt;&lt;P&gt; CALL FUNCTION func IN BACKGROUND TASK AS SEPERATE UNIT &lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 06:47:11 GMT</pubDate>
    <dc:creator>Private_Member_424367</dc:creator>
    <dc:date>2022-08-08T06:47:11Z</dc:date>
    <item>
      <title>Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579112#M2009180</link>
      <description>&lt;P&gt;Hello everyone,,&lt;/P&gt;
  &lt;P&gt;I have a question regarding the use of BAPI inside BADI, customer exits or any enhancement techniques. We need to use BAPI_COMMIT FM after calling the bapi but if we are using the BAPI inside anyone of the enhancement techniques, then in that case what should be our approach since we should not use commit inside any enhancement?&lt;/P&gt;
  &lt;P&gt;Also, my second question is that if the bapi returns a locking error here then what should we do? Use deque FM in the enhancement? Wouldn’t that release locks for other objects as well!&lt;/P&gt;
  &lt;P&gt;Any help would be very much appreciated here!&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 14:19:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579112#M2009180</guid>
      <dc:creator>former_member721373</dc:creator>
      <dc:date>2022-07-07T14:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579113#M2009181</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;eihtu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;First of all, it is not carved in stone that you must not call BAPIs or execute commit work in enhancements. It all depends on the nature of the enhancement and when it is called. I do agree however, it is safer to avoid commits in enhancements.&lt;/P&gt;&lt;P&gt;The solution is to wrap BAPI call and subsequent BAPI_TRANSACTION_COMMIT is an RFC function module. Then call the function from the enhancement in a separate LUW (logical unit of work) using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION func IN BACKGROUND TASK
                   AS SEPARATE UNIT&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;See SAP Help on &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcall_function_background_task.htm#!ABAP_ONE_ADD@1@"&gt;AS SEPARATE UNIT&lt;/A&gt; addition.&lt;/P&gt;&lt;P&gt;That trick also solves locking problems in BAPI processing.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dominik Tylczynski&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:38:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579113#M2009181</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2022-07-07T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579114#M2009182</link>
      <description>&lt;P&gt;As a rule of thumb, &lt;/P&gt;&lt;P&gt;Inside the BADi - We should not use any BAPI that finished with Commit . Because BADi is are in generally in betwen process where we put of deviations and/or validations. &lt;/P&gt;&lt;P&gt;Anything that commits or locks - will create incosistencies. &lt;/P&gt;&lt;P&gt;for your second question also, though DEQUE releases the lock, it may create incosistencies too.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579114#M2009182</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-07-07T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579115#M2009183</link>
      <description>&lt;P&gt;Hello Dominik,&lt;/P&gt;&lt;P&gt;Sorry for the late response! Thank you so much for your answer.&lt;/P&gt;&lt;P&gt;So if the Badi changes fails in between, and a rollback happens. The changes by the BAPI in this FM will also be rolled back? Or it is commited? I am new to SAP LUW’s scenarios. So if you can help me understand whether the Background task will be part of the same SAP LUW  or a separate one in this case?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 13:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579115#M2009183</guid>
      <dc:creator>former_member721373</dc:creator>
      <dc:date>2022-08-03T13:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579116#M2009184</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;eihtu&lt;/SPAN&gt; You should either call BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK depending on the BAPI call results, if it is successful or not.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 13:16:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579116#M2009184</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2022-08-03T13:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579117#M2009185</link>
      <description>&lt;P&gt;Hi Dominik,&lt;/P&gt;&lt;P&gt;I created RFC to update BP and added BAPI_TRANSACTION_COMMIT in it after BP update BAPI. Called RFC as below inside BAPI but it seems it does not consider BAPI_TRANSACTION_COMMIT added in the RFC. Commit happens only when it receives commit outside RFC..&lt;/P&gt;&lt;P&gt; CALL FUNCTION func IN BACKGROUND TASK AS SEPERATE UNIT &lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 06:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579117#M2009185</guid>
      <dc:creator>Private_Member_424367</dc:creator>
      <dc:date>2022-08-08T06:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579118#M2009186</link>
      <description>&lt;SPAN class="mention-scrubbed"&gt;eihtu&lt;/SPAN&gt;&lt;P&gt;Can you share the code of your RFC function that wraps up the BADI?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 11:04:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579118#M2009186</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2022-08-08T11:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579119#M2009187</link>
      <description>&lt;P&gt;  ls_centraldata-centralblock = space.&lt;/P&gt;&lt;P&gt;
  ls_centraldata_x-centralblock = 'X'.&lt;BR /&gt;
&lt;BR /&gt;
  CALL FUNCTION 'BAPI_BUPA_CENTRAL_CHANGE'&lt;BR /&gt;
    EXPORTING&lt;BR /&gt;
      businesspartner = iv_partner&lt;BR /&gt;
      centraldata     = ls_centraldata&lt;BR /&gt;
      centraldata_x   = ls_centraldata_x&lt;BR /&gt;
    TABLES&lt;BR /&gt;
      return          = et_return.&lt;BR /&gt;
  IF sy-subrc = 0.&lt;BR /&gt;
    READ TABLE et_return TRANSPORTING NO FIELDS&lt;BR /&gt;
    WITH KEY type = 'E'.&lt;BR /&gt;
    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;BR /&gt;
        EXPORTING&lt;BR /&gt;
          wait = 'X'.&lt;BR /&gt;
    ENDIF.&lt;BR /&gt;
  ENDIF.&lt;/P&gt;

&lt;P&gt; &lt;/P&gt;

&lt;P&gt;…… Inside
BADI&lt;/P&gt;

&lt;P&gt;        CALL FUNCTION 'ZRFC' IN BACKGROUND TASK&lt;BR /&gt;
          AS SEPARATE UNIT&lt;BR /&gt;
          EXPORTING&lt;BR /&gt;
            iv_partner = lv_bp_num&lt;BR /&gt;
          TABLES&lt;BR /&gt;
            et_return  = lt_return.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 11:50:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579119#M2009187</guid>
      <dc:creator>Private_Member_424367</dc:creator>
      <dc:date>2022-08-08T11:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579120#M2009188</link>
      <description>&lt;P&gt;I would drop &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sy-subrc = 0.
...
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;right after the BAPI call.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 13:24:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/12579120#M2009188</guid>
      <dc:creator>Dominik_Tylczynski</dc:creator>
      <dc:date>2022-08-08T13:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use BAPI inside Customer Exits or BADIs?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/13691204#M2027901</link>
      <description>&lt;P&gt;Yes we can use bapi inside badi .&lt;/P&gt;&lt;P&gt;I have worked on one requirement where badi is used to populate a bapi as some fields were not available in bapi so that it can be executed successfully.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 19:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-bapi-inside-customer-exits-or-badis/m-p/13691204#M2027901</guid>
      <dc:creator>anjalihora</dc:creator>
      <dc:date>2024-05-03T19:12:30Z</dc:date>
    </item>
  </channel>
</rss>

