Dump in 'BAPI_MATERIAL_AVAILABILITY' for mass materials....

Hi Experts,
pl. help us for following abap. I have fetched nearly 40,000 materials in itab and when i am executing it is taking long time 10-20 minutes or it is giving dump.
   DATA: iwmdvsx TYPE TABLE OF bapiwmdvs WITH HEADER LINE,
    iwmdvex TYPE TABLE OF bapiwmdve WITH HEADER LINE.
    DATA: r TYPE bapireturn, " Check it once.
    FQty TYPE MENGV13.
    jtab[] = itab[].
    LOOP AT itab.
      CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
      EXPORTING
      plant = 'HIP' "p_werks
      material = itab-matnr "p_matnr
      unit = 'EA' "p_meins
      stge_loc = 'BSR'
      IMPORTING
      return  = r
      TABLES
      wmdvsx = iwmdvsx
      wmdvex = iwmdvex.
      IF r-type is initial OR r-type = 'S'.
        LOOP AT  iwmdvex.
          FQty = FQty + iwmdvex-com_qty.
        ENDLOOP.
        jtab-free_qty = FQty.
        MODIFY jtab TRANSPORTING free_qty WHERE matnr = itab-matnr.
        FQty = 0.
      ENDIF.
      REFRESH iwmdvex.
      CLEAR: itab.
      REFRESH iwmdvsx.
    ENDLOOP.

This is the way i do it. See if it helps:
      LOOP AT I_WERKS.
        refresh: return.
        CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
          EXPORTING
            plant      = I_WERKS-LOW
            material   = I_MARA-MATNR
            unit       = 'EA'
          IMPORTING
            av_qty_plt = bapi_onhand
            return     = return
          TABLES
            wmdvsx     = atp1
            wmdvex     = atp2.
        IF return IS INITIAL.
          READ TABLE atp2 WITH TABLE KEY bdcnt = 0
                                           req_date = sy-datum
                                           com_date = sy-datum.
          IF atp2-com_qty <> '9999999999.000'.
            ONHAND = ONHAND + atp2-com_qty.
          ELSE.
            ONHAND = ONHAND + bapi_onhand.
          ENDIF.
        ENDIF.

Similar Messages

  • Reg:Bapi for mass creation of production order/confirmation

    Dear Experts,
    I wanted to know with the following BAPI is it possible to create Multiple production orders for different semifinshed Materials along with material availability check and other functions similar to CO01 transaction.
    I knew there are standard transactions for mass confirmation for production orders. But i need a confirmation on this BAPI . As i am planning to go-ahed with ,mass creation of production order creation / Order confirmation in single custom transaction.Need back flush activity even supported.
    BAPI_PRODORD_CREATE to create the orders.
    BAPI_PRODORD_RELEASE to release the orders.
    BAPI_PRODORDCONF_GET_TT_PROP to get the default data for the confirmation.
    BAPI_PRODORDCONF_CREATE_TT to ost the confirmation of production order.
    Along with this BAPI do i need to commit any other BAPI to carry out back flush for components.
    Need your suggestions to take it further.
    Regards,
    Daya.

    Dear SAP Daya
    If the issue has been solved, please close this thread.
    You have already mentioned that the issue has been resolved, thefore, you should not ask for help on another thread before closing this one, as it looks like you are trying to force people to answer your threads.
    Users are always trying to answer as many threads as possible on good will we don't need this kind of "incentive".
    Please read carefully the The SCN Rules of Engagement, especially point 8:
    Be responsive. If an SCN member has answered your question, please mark the answer as "helpful” or “correct”. Mark the discussion as “answered,” so that other members can find the answers more easily
    Also, I checked your old threads and I could observe that there is only one closed. Please review your old threads and close those already solved.
    BR
    Caetano

  • How to activate the new fields on material master(MM01/MM02/MM03) for existing Materials

    Hi,
    We have a requirement to add  some custom fields as a new tab in additional data option(Descriptions, Unit of measure, etc.) in Basic data of Material master (MM01/MM02/MM03). I have successfully added and these custom fields and they are not part of standard(MARA, MARC) but a custom table and the updates are also done in custom table.
    For new materials, I can see the new tab in additional data screens of basic data view and I could successfully create/change/display using MM01/MM02/MM03. However I cannot see the new tab/fields for existing materials in the system in all 3 tcodes (MM01/MM02/MM03). This is not a main view in material master so that I can extend it by MM01.
    Is there any setting or mass generation program I have top perform so that I can see and maintain these new fields for existing materials. Appreciate any leads or help on this.
    Thanks,
    Harry

    Hello Harry,
    Goto t.code SPRO ---> Display IMG --->  Logistics - General --> Material master --> Configuring the material master --> Create program for customized screens
    Use the above path and create the screen and assign it to the sequence using the below link as reference.
    **************** - Tips - Implementing screen exits for MM01/MM02/MM03
    Regards,
    Thanga

  • Urgent need for Study Materials for 1Z0-114 certification

    Hi All,
    I would be taking up the Oracle SOA Foundations, Adoption and Implementation(1Z0-114) certification next month. For study materials & free dumps I did some search over the net but with no luck yet. Can somebody please point me towards the right direction from where i can get these. Also for reference which text books should i follow? Many thanks..
    Regards,
    Tripz

    >
    Hi All,>
    I would be taking up the Oracle SOA Foundations, Adoption and Implementation(1Z0-114) certification next month. For study materials & free dumps I did some search over the net but with no luck yet. Can somebody please point me towards the right direction from where i can get these. Also for reference which text books should i follow? Many thanks..>
    Regards,
    TripzThe first thing the certification candidate needs to understand is there is basically no such thing as right direction and +(brain)dumps
    The dumps to be found on the net, and from most non approved supplied, are non authorized learning material:
    See: [http://blogs.oracle.com/certification/2009/05/the_route_you_choose.html]
    So if you use or continue to search for dumps you will be cheating.
    The post {message:id4015916} seems to refer to some useful books.
    The thread {thread:id=833598} appears to be useful, and has been reviewed by the Certification forum moderator.
    Edited by: bigdelboy on 02-Feb-2010 22:40 (typos)

  • Need to do availability check for multiple materials (in bulk)

    HI Friends,
    I need to do availability check for multiple materials. Currently i am using function module AVAILABILITY_CHECK within a loop.For my purpose I could find this particular FM as well as BAPI "BAPI_MATERIAL_AVAILABILITY" however both of this options can not be used for more then one materials at a time.
    I want to take out the loop from the code and get multiple materials be ckecked at once for availability. If AVAILABILTY_CHECK FM can be used for multiple materials, please post the usage.
    Any other options are there?
    Any help or clue would be appreciated.
    Thanks in advance.

    Use the BAPI.  Even if such a function existed, it would still perform the relevant internal logic required for checking by material, so you wouldn't gain anything.

  • ATP check for multiple materials on multiple sales document

    Hi,
    System 4.70
    Is it possible to carry out an ATP check for multiple materials on multiple sales documents.
    I have written a bespoke program and the program requires an ATP check to be performed for each material and sales document, I am currently using BAPI_MATERIAL_AVAILABILITY which is bringing back the necessary information but it's a bit slow.
    Does any one have any ideas please.
    Regards
    J-J

    The ATP Check using the BAPI is done per material and plant. If you're looping through sales documents and then materials you're probably doing the ATP check for the same material over and over again.
    Just get the list of materials you need and the corresponding plants and call the BAPI for each of them.
    Also do a run-time analysis (tcode SE30) to check exactly what slows down your program.
    regards.

  • MM06 -flag for deletion materials in massive

    Hello,
    I would like to know if and how I can massively mark materiales for deletion.
    Transaction MM06 only works for individual materials.
    Thanks for any answer
    Aart

    You can do
    1) BDC recording ( Old method not preferred)
    2) LSMW ( New recording method but still not preferred for your case)
    3) MASS tcode with Object Type "BUS1001"
    4) MM17 tcode ( Best Option)
                    Go to MM17--Select the MARA table and execute
                     Click on the icon at the bottom right and select the field Deletion indicator "DF at Client Level"  and bring it to the left
                     Give the materials you want to change and execute ..in the new value select it to be
                      Test it with the icon on the right and then execute it.
    Hope that helps...

  • Unable to capture Part 2 for exicse materials

    Hi
    In import Purchase order scenario I am unable to capture part 2 for excise materials
    First I have created import PO. Then I did miro where I posted BED,AED,ECS,SECss
    After that I did migo and captured part 1
    After that while I was capturing part 2 with ref to vendor invoice I m getting an error message as
    NO CENVAT AMOUNT TO BE POSTED
    NO CENVAT AMOUNT TO BE REVERSED
    We are using taxinj
    Can u please help me out in solving this issue?
    Rahul

    Hi,
    Once you have entered the needed information about the connection string and container, go to Object Tab and select the objects. then the Start button will enabled.
    Another way to reverse engineer is to use ERD component. Refre to the Note 299067.1 in Metalink.

  • Report for mass interruption of partially confirmed orders in PPDS?

    Hi gurus,
    our client has a lot of partially confirmed orders in the past, and this is giving us problems with the optimizer.
    Is there a report for mass interruption of this orders?
    We can do it one by one in the DS planning board, but there are too many!
    would appreciate any help,
    Pablo

    Hi Pablo,
    I would suggest you can close the partially confirmed orders at R/3 itself
    so that it will update in APO via CIF.
    There is delivery complete indicator in R/3 production/process order which
    upon checking will close the order.
    Regards
    R. Senthil Mareeswaran.

  • Report for consignment materials

    Hi SAP Gurus,
    Is there a report for consignment materials that can show us the opening balance, receipts, Usage, and ending balance (of the stock) for a given time frame?
    thanks
    Anusha

    This doesn't do any good. it just gives the vendor information. I'm not looking for this. I'm looking for a report or a t code which gives what the opening stock levels, receipts of stock, usage of stock and ending balance of stock for consignment materials for a given time period for a plant
    thanks
    Anusha

  • Standard Report to check consumption values for multiple materials

    Hi,
    Is there any standard report to check "consumption" values for multiple materials? The user needs to check the consumption values over a period of time for multiple materials (VERP, ROH) before deciding the re-order and safety stock values for them. Any help on this will be greatly appreciated.
    Thanks,
    Swapnil

    Dear Swapnil,
    Report MCRE is widely used for the material cosnumption than checking in COOIS.
    Also these reports can help you.
    MCPF                 Material analysis: Dates                
    MCPO                 Material analysis: Quantities           
    MCPW                 Material analysis: Lead time            
    Regards
    Mangalraj.S

  • How to maintain One product cost collector for multiple materials and configuration setting

    Hi experts,
    my requirement is that i want to maintain one product cost collector for multiple materials ans also i want to know the configuration setting for the same.
    I have used KKF6N but it is not working in my case. I went through KKF6M also but there i found multiple cost collectors.
    please guide me in the same.
    Thanks in advance.

    Hi Shripad,
    you cannot assign same  Product cost collector to different material.
    Because you creating cost collector for material combination of material /production version,material /Bom Routing.
    so please create individual cost collector for every material.
    if you have any query kindly revert back.
    Please mark the answer as helpful if it is helpful to you.
    Because march 5 onwards scn has stopped awarding points to liked content.
    Starting now: No more points for likes on comments/replies
    Thanks & Regards
    Sandeep Kumar Praharaj

  • One pr for multiple materials with line items while running mrp

    Hi SAP gurus,
                  I am config the system for MRP as per my client requerement.
                     We use CBP for different RAW materialsfor example they having a 10 materials for planning,were,
             MRP type is VB,
              LOT size is FX,with Different Reorder points and fix order quantity for all materials,
             My client whant run MRP for all these materials in single time that means they whant multiple item at single levels,
            i soles these requirement with the help of Product Group(sop) and its working but when we running md02 for product group all materials have planed and they give different purchase requistion numbers for all these materials but my client Wants single purchase requistion with line items for all these materials.
         Pls give me the solution for that requirement.
    thanks and Regards,
    abhi

    this is not the way SAPs MRP run works.
    Where is the benefit for this?
    the requisitions are not even split into header and item table, it is just one table EBAN, and either way you would get exact the same number of records in EBAN.

  • Is it possible to combine multiple Pur Reqs for multiple materials to one vendor into one PO through MD07?

    We have material planners who use MD07 (traffic signal screen) Stock/Requirements List, Collective Access tab to review material requirements by MRP Controller.  Once the list is created, they select individual materials and review them in MD04.  In a lot of cases, Purchase Reqs (PRs) are reviewed and adopted into POs individually for each material.  Sometimes they will combine multiple PRs for one material into one PO.  This is a good practice.  However, from what I have found, it is not possible to combine multiple PRs for multiple materials into one PO.  If this was done it would dramatically reduce the number of POs that we are issuing to suppliers.  Problem statement:  We issue too many POs which causes additional influxes down the line (receiving dock/goods receipts processing, receiving issues, invoices, invoice issues, etc.).  Does anyone know of a way to address this problem without a major overhaul in approach or customization of the system?  Thank you in advance!   

    Hello Michael
    As far as I know, this is not possible directly from MD07, only from the MM transactions.
    The following thread suggests the following procedure to convert several PRs into one PO:
    Conversion of multiple PR into single P.O
    Drag and drop the first PR from the item overview to the shopping card on top of ME21N,
    then open the PO detail delivery schedule tab and drag  and drop all other PR to the shopping card shown  in the schedule tab
    You can use the same procedure, calling the order conversion from MD07 and then drag and drop another PRs into this PO.
    BR
    Caetano

  • Text Mandatory only for Certain Materials in Sales Order

    Is there anyway so that I can make certain item text mandatory only for certain materials?
    I tried creating new item category group and new item category. And then create new Text procedure making this text mandatory and assigning to this new item category.
    But there are lot of different types of item categories assigned. So it does not look good to create new item category for each and everyone for this new item category group and material.
    Please guide me how to make the document incomplete for certain materials only when one text is not filled at item level
    Thanks in advance

    Hi,
    what you tried is correct and that is been followed in most of my projects wherever I worked.  That is the best way recommended also.
    If you try with incompletion procedures for item category also, you will endup doing multiple item categories anyway....
    First when I looked at the subject line, even before I opened your POSTING, I got the same resolution as you did....May be the optimal one but, not sure, if something else is possible other than by doing user exit.
    Regards

Maybe you are looking for