<?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: BADI Execution in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324542#M1227089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare a Variable in your BADI as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : Flag .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inside the Badi follow this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORT FLAG FROM MEMORY ID 'FL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT FLAG IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Badi code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move X to FLAG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORT FLAG TO MEMORY ID 'FL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;****************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you enter the BADI for the first time FLAG will have no value when you import &amp;amp; after you execute it for the firs time you will find the value X &amp;amp; so next time on it will not pass the IF condition &amp;amp; so your requirement can be achieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Mar 2009 17:06:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-05T17:06:00Z</dc:date>
    <item>
      <title>BADI Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324541#M1227088</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;MD01, for a single plant  it must create a purchase requisition consolidating  all the material assosiated to it, instead of creating different PR for each planned order.If the BADI is executed for the first time we are calling bapi_requistion_create for the summed up material quantity,for the next execution of badi we are calling bapi_pr_change to add the items in the PR.We were able to change but not able to add new items to the existing PR.Can we use bapi_pr_change to add new items to the existing PR?How can we identify that the BADI is executed for the 2nd time so that we can find out where we are going wrong while adding items to an existing PR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 15:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324541#M1227088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-05T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: BADI Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324542#M1227089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare a Variable in your BADI as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : Flag .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inside the Badi follow this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORT FLAG FROM MEMORY ID 'FL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT FLAG IS INITIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Badi code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move X to FLAG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORT FLAG TO MEMORY ID 'FL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;****************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you enter the BADI for the first time FLAG will have no value when you import &amp;amp; after you execute it for the firs time you will find the value X &amp;amp; so next time on it will not pass the IF condition &amp;amp; so your requirement can be achieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 17:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324542#M1227089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-05T17:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: BADI Execution</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324543#M1227090</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 had checked in Debugging if the PRNo is initial it is processing bapi_requisition_create else it is processing bapi_pr_change and it is indeed including the items in PR.But,sometimes it is not.&lt;/P&gt;&lt;P&gt;Do we need to call BAPI_TRANSACTION_COMMIT even after bapi_requisition_create ?I am calling BAPI_TRANSACTION_COMMIT only for/after &lt;/P&gt;&lt;P&gt;bapi_pr_change.Is that the problem ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: k464748 on Mar 9, 2009 3:29 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 12:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi-execution/m-p/5324543#M1227090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T12:58:57Z</dc:date>
    </item>
  </channel>
</rss>

