<?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 BAPI_MATERIAL_AVAILABILITY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854659#M46948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone used this function ?? &lt;/P&gt;&lt;P&gt;It does what we need, but it takes a lot of time.&lt;/P&gt;&lt;P&gt;We have to process about 2500 sales ordes with about 25.000 lines, and it takes hours to process them. Without this function the hole process takes about 12 minutes.&lt;/P&gt;&lt;P&gt;What other solution do we have, or what is the problem with this function ????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 May 2005 08:03:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-05-20T08:03:50Z</dc:date>
    <item>
      <title>BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854659#M46948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone used this function ?? &lt;/P&gt;&lt;P&gt;It does what we need, but it takes a lot of time.&lt;/P&gt;&lt;P&gt;We have to process about 2500 sales ordes with about 25.000 lines, and it takes hours to process them. Without this function the hole process takes about 12 minutes.&lt;/P&gt;&lt;P&gt;What other solution do we have, or what is the problem with this function ????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 08:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854659#M46948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T08:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854660#M46949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivanov,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also run, BAPI_SALESORDER_SIMULATE which if you pass sales order line items, will return the proposed delivery date for them (having performed an availability check).  The benefit of this is you are not restricted to one item per call, so you don't get the overhead for each item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used BAPI_MATERIAL_AVAILABILITY quite a bit and haven't noticed it to be prohibitively slow.  There are, however, lots of customising settings fot ATP that could impact your performance (scope of check, use of APO, etc.). Also, be aware that when you perform availability checks you are setting up lock entries for material plant combinations, which can cause subsequent calls to be queued.  You should design your threads carefully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you processing the sales orders that you can process 25000 lines in 12 minutes?  Are you saving them into SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.  Perhaps you could post a little more on what you are doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 08:25:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854660#M46949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T08:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854661#M46950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the function sales_document_create.&lt;/P&gt;&lt;P&gt;Maybe will be 20 minutes after all, depends on the hour, but we will process them at night.&lt;/P&gt;&lt;P&gt;You probably have right Brad, with the lock mecanism, because this is what i've noticed.&lt;/P&gt;&lt;P&gt;For the first 200, 300, orders, the time is not exeptionaly but resonable, after that..... more and more time. hours.... &lt;/P&gt;&lt;P&gt;I could use the "simulate solution", at least try it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 08:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854661#M46950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T08:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854662#M46951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you save them into SAP, why do you perform an availability check first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't you just get the results from when you create the sales orders? Or does the result of the ATP check affect what you put into the order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If locking problems are what you are encountering, you will get them also with SIMULATE, but at least you can process bundles rather than one material at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for my understanding do you sequnce the calls like this:&lt;/P&gt;&lt;P&gt;1. Availability check&lt;/P&gt;&lt;P&gt;2. Post order&lt;/P&gt;&lt;P&gt;1. Availability check&lt;/P&gt;&lt;P&gt;2. Post order ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or do you do all the availability checks first and then post the orders?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 08:50:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854662#M46951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T08:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854663#M46952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can not do the availability check when I save the order because :&lt;/P&gt;&lt;P&gt;the invoice is made in another system, with an exact quantity and value. i have to introduce into sap the same invoice. So, if I have o position with 2 on quantity and  in stock i have 1, the order is saved with 1, and this is not good for me. so , i have to make the check before i save the order.&lt;/P&gt;&lt;P&gt;the check is made, as you said, in this sequence &lt;/P&gt;&lt;P&gt;1. Availability check - line by line, this means, material by material,&lt;/P&gt;&lt;P&gt;2. Post order&lt;/P&gt;&lt;P&gt;1. Availability check- line by line,&lt;/P&gt;&lt;P&gt;2. Post order ... etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mabe the sequence is wrong ?&lt;/P&gt;&lt;P&gt;Or is it better to call the BAPI_MATERIAL_AVAILABILITY after the order is saved, but not commited, in this case I can put into the parameters of the function the document number also ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 09:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854663#M46952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T09:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854664#M46953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivanov,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like you are running an FI only solution, yes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you care about ATP checking at all?  Maybe you could switch it off in the sales order/delivery?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another idea (assuming you need ATP), borrowing off your commit concept, is to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create the order (without commit)&lt;/P&gt;&lt;P&gt;2. Check the availability results of each line in the order to ensure full quantities&lt;/P&gt;&lt;P&gt;3. If all lines ok, COMMIT&lt;/P&gt;&lt;P&gt;4. If some lines not ok, use the results to calculate dates when all lines will be ok&lt;/P&gt;&lt;P&gt;5. ROLLBACK the order&lt;/P&gt;&lt;P&gt;6. Post a new order with new line item dates&lt;/P&gt;&lt;P&gt;7 COMMIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will help a lot, as (depending upon your industry) generally items are available for orders, and only on an exception basis will you be required to do additional processing (and you will avoid doing additional ATP calls).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 10:00:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854664#M46953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T10:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854665#M46954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it's a good idea, but...&lt;/P&gt;&lt;P&gt;the sale order does not save without a commit.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, how can I return with rollback ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 10:22:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854665#M46954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T10:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854666#M46955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Taking my steps (more technical view):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You can call the BAPI to create the order&lt;/P&gt;&lt;P&gt;2. Check the parameters returned by the BAPI (for availability results)&lt;/P&gt;&lt;P&gt;3. If all lines ok, call function 'BAPI_TRANSACTION_COMMIT' and finish&lt;/P&gt;&lt;P&gt;4. If some lines not ok, then determine dates when all lines will be ok&lt;/P&gt;&lt;P&gt;5. Call function 'BAPI_TRANSACTION_ROLLBACK'&lt;/P&gt;&lt;P&gt;6. Call BAPI again to create the order&lt;/P&gt;&lt;P&gt;7 Return to step 3.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 10:29:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854666#M46955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T10:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854667#M46956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One downside to this approach is that each time you ROLLBACK a sales order you will lose that order number.  This will lead to occasional gaps in your order numbers.  This may or may not be an issue for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 10:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854667#M46956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T10:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854668#M46957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"  2. Check the parameters returned by the BAPI (for availability results)  ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the problem... What is the parameter that tells me that req. quantity = confirmed quantity  ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 11:56:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854668#M46957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T11:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854669#M46958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivannov,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, i mixed up BAPI_SALESORDER_SIMULATE with BAPI_SALESORDER_CREATEFROMDAT2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no return parameter from BAPI_SALESORDER_CREATEFROMDAT2 to check the schedule lines, but you have a few options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- in the USEREXIT_SAVE_DOCUMENT export the XVBEP internal table to memory.  You can then import it into your calling program and use it for your processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If you are calling the BAPI from outside of SAP you could interpret the XVBEP table in USEREXIT_SAVE_DOCUMENT and issue messages (MESSAGE I100 with ...) that should be returned to you in the RETURN parameter of the BAPI (haven't tested this, but should work).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, with regards to the gaps in the number ranges that I mentioned in a previous post, you can overcome this by using an external number range on your sales order (and use the NUMBER_GET_NEXT function to generate your own) only generate a new one for each actual new sales order.  Thus, when you do rollback work, you just keep that number and re-use it for the next call of the create order bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might sound a bit elaborate, but the performance improvement (given your initial figures) will be enormous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Brad Williams&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 13:17:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854669#M46958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854670#M46959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivanov,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is it progressing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think that this process can work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2005 14:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability/m-p/854670#M46959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-20T14:47:21Z</dc:date>
    </item>
  </channel>
</rss>

