Get the qty from the unrestricted stock

Hi,
   My Requirment is below
     Select material (MATNR), plant (WERKS), unrestricted stock (LABST) from table MARD where material (MATNR) IN S_MATNR AND plant (WERKS) IN S_WERKS. Inner join the selection above with table MAKT to retrieve the material description (MAKTX) into itab1. Collect the itab1 to add all the unrestricted stock. For abaper’s info, the data retrieved from table MARD is by storage location. All these storage location will be added to get the total qty for that material.
Select single material group (MATKL), external material group (EXTWG), unit of measurement (MEINS), division (SPART) from table MARA where MATNR = itab1-matnr.
In this how to get the total qty for that material.pls help me to find the quantity.
Thanks,
Regards,
Rajendra.

Hi ,
  The code can be split into two portions first select the data from the tables mara , mard and makt , and second is loop on this table and collect the data into another internal table.
here is a code which does the same
tables : mara , mard.
data : begin of it_1 occurs 0 ,
        matnr type matnr ,
        matkl type matkl ,
        meins type meins ,
        spart type spart ,
        werks type werks_d ,
        lgort type lgort_d ,
        labst type labst ,
        maktx type maktx ,
       end of it_1.
data : begin of it_2 occurs 0 ,
        matnr type matnr ,
        matkl type matkl ,
        meins type meins ,
        spart type spart ,
        werks type werks_d ,
        labst type labst ,
        maktx type maktx ,
       end of it_2.
select-options : s_matnr for mara-matnr ,
                 s_werks for mard-werks.
start-of-selection.
select mara~matnr mara~MATKL mara~MEINS mara~SPART
       mard~werks mard~lgort mard~LABST makt~maktx
into table it_1
from ( mara inner join mard
on mara~matnr = mard~matnr )
inner join makt
on mara~matnr = makt~matnr
where mard~matnr in s_matnr and
       mard~werks in s_werks and
       makt~spras = sy-langu.
loop at it_1.
  move-corresponding it_1 to it_2.
  collect it_2.
clear it_2.
endloop.
regards
Arun

Similar Messages

  • How to get the item stock for a date

    Hi all
    I need to get the item stock quantity on a date, but i don´t know if i can get it from a table or if i have to make a query to calculate it from the documents´lines. If you can help me please reply this post.
    Thanks

    Do you already know of table OINM (Warehouse table) - it is not documented in SAP-BO references?
    This table contains entries for each movement in stocks of your system. Here are some examples of fields in this table:
    BASE_REF document number of document affecting OITW.OnHand
    DocDate      date of this document
    ItemCode     Item of which the stock quantity is changed
    Dscription    name of item
    Warehouse  affected stock
    InQty       number of items added into stock (OITW.OnHand is increased)
    OutQty       number of items taken from stock (OITW.OnHand is decreased)     
    TransType   type of booking (see below)
    Balance      this is NOT the OITW.OnHand at the date of this booking;
                      it's something like the cumulated stock value in some currency
    To calculate the OnHand-value at a date of any of these bookings you have to
    sum up the incoming/outgoing quantities, e.g. (z.B. SUM(InQty) - SUM(OutQty)).
    Relation between the type of booking and the values in InQty / OutQty:
      ++ InQty/OutQty contain the number of items added to/taken from the stock;
      the number complies to the value OITW.OnHand is increased/decreased;      
      -- doesn't affect stock (InQty/OutQty = 0)
      ? missing documentation
    TransType InQty OutQty
    -2              ++     --         opening balance
    13      --       --         outgoing invoice
    13              --      ++          outgoing invoice without previous delivery note
    15              --      ++        delivery note
    18              --       --         incoming invoice
    20             ++      --         incoming delivery note
    58             ?        ?          inventory
    59             ++      --         stock receipt (without purchasing transactions)
    60              --      ++        goods issue (without sales transactions)
    67              --      ++        transfer between stocks
    67             ++      --         transfer between stocks
    I hope that I got your question right and that my hints will help you!
    Frank

  • I would like to know how to get the unrestricted quantity excluding actual customer ordr quantities on a given group of items?

    I would like to know how to get the unrestricted quantity excluding actual customer ordr quantities on a given group of items?

    Hi , Welcome to the HP Forums!
    It is a terrific place to find answers and tips!
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide.Learn How to Post and More I grasp you would like to replace the keyboard and would like the part number and where to purchase one. Here is a link to the HP Pavilion 17 Notebook PC HP Pavilion 15 Notebook PC Maintenance and Service Guide .  Please note chapter 3, page 20, item 2 for the replacement keyboard part numbers. You stated you were having a difficulty locating where to purchase the part.  Here is a link to  HP Notebook PCs - Ordering HP Certified Replacement Parts for your convenience. You can also try a Google search with the part number for other vendors that may have one.   To say thanks for replying please click the thumbs up icon below. If this has addressed your query please choose solution provided to help other people locate this information.   Best of Luck!

  • Can system consider the unrestricted stock when planned with MD50???

    Hi,
    We have scinerio where FERT with Strategy 20 (MTO Process) is planned with MD50 against the sale oder. Every time Dependent items stock needs to be posted with Movement type 412E against that sale order or else dependent items stock though available in unrestricted is shown as unable against that sale order no. Enitre cost of the FERT material is accounted against sale order number.
    Can we avoid posting of sales order stock?? can we make system to consider the unrestricted stock when planned with MD50.
    Thanks in advance,
    Regards,
    John

    if u want to consume the unrestricted stock, why u implemented MTO??
    what was the requirement to implement MTO, when u r asking such question in support............
    check first requirement of the client.......if u think they need to consume unresc stock...i will say...implentation was very poor,
    regards,
    Pravin M

  • How to issue parts from our Unrestricted stock to Vendor QI stock (Subcont)

    Hi ,
    In subcontrating process , I wanted to transfer material from my unrestricted stock to Vendor QI stock where subcontrator will test the quality of the material and only if it gets approved it will be used for process otherwise will be returned back to us.
    For this I wanted to transfer my stock in QI stock of Subcontrator, how can I do that ?
    Similary is there any way to Transfer material back from Subcontrator Blocked stock to my unrestricted / Blocked Stock.
    Thx in Advance
    Regards
    Sandeep Marwha

    Blocked stock at a subcontractor is not possible. The table containing the stock at a vendor is MSLB, and this table just does not have a field for blocked stock.
    if you use batch management, then you can have restricted stock.
    Edited by: Jürgen L. on May 6, 2008 4:04 PM

  • Reg:  material type according to the unrestricted stock equals to zero.

    Hi gurus,
    how to use alv for this .
    regards,
    vivek

    Hi,
    Are you talking about the KMAT purchases should be always sales order specific, if yes then In MRP4 view of material master, enter Individual/Collective as "1" (Individual Stock)
    And now, if you want the Stock Valuation of Sales Order then check following points;
    1. Go to VA03 - Here under "Procurement" Tab, get the RqTy (Requirement Type, for e.g. KE)
    2. Go to OVZH - Here get the Requirement Class assigned to this Requirement Type (for e.g. 040)
    3. Go to OVZG - Here go to details of Requirement Class (for e.g. 040) and check following under "Account Assignment" Tab,
    Acct.assig.cat. - M
    Valuation - Blank
    Here Valuation should be "M" i.e. Separate valuation with ref. to sales document/project
    If it is blank, then you can not enter "M" here in this screen.
    4. Go to SPRO > Sales and Distribution > Basic Functions > Account Assignment/Costing > Maintain Requirements Classes For Costing/Account Assignment > Here for Requirement Class (for e.g. 040), maintain Valuation as "M" i.e. Separate valuation with ref. to sales document/project
    Now run a complete new cycle and check.

  • Outbound delivery allows only the unrestricted stock for particular material and plant

    Hi,
    In STO I have an problem the outbound delivery creations allows all stocks under unrestricted, Quality inspection, Block stock.
    I want the outbound delivery creation of a particular material and  plant it allows only the stock under the unrestricted only. It doesn't allows the stocks under the Quality inspection and Block stocks.
    I need to know how to configure this or how to solve my requirements.
    Regards,
    Ramesh N

    Dear Mohammed ,
    as per your scenario , there is two movement type has to trigger in the Delivery level according to the plant and material combination .
    as per my knowledge it will not configurable in standard process . this will possible with user exit logic only .
    follow the below logic to achieve your issue .
    you have to create two item categories and two schedule lines with (655 &653) , that means your movement type has to trigger at sales order level only . write a logic in the user exit - MV45AFZZ -USEREXIT_MOVE_FIELD_TO_VBAP , if this combination matches then automatically item category has to over write other wise it will copy the existing item category .at delivery level you can see two movement types in item level.
    wait for other experts solution , if any standard is possible or not  .
    Regards,
    C.B Reddy.

  • Get HU qty from ASN

    Hello,
    We has already establish ASN inbound connection with supplier.
    Problems is that different packing standard do not allow us to collect HU qty from ASN.
    Is there anyway to get this packing HU qtys and recorded in LA?
    Thanks.

    Hi,
    I hope the below details are helpful for you.
    First we have to create the packing instruction in POP1.
    --> Give a packing instruction name.
    --> Then in the line 1 - Enter P and the packaging material
    --> Then in the line 2 - Enter M and enter the material to pack and give the quantity to pack in the packaging material. Eg: In each pallet how much quantity to be packed.
    Second go to the transaction POF1.
    --> Enter RCPT and based on the combination Material/Plant/Vendor, select it and enter the Material and the Packaging Instruction you created before.
    --> Then you can do the autopack in VL32N.
    Regards,
    Shetty

  • Putting stock into Quality from the Unrestricted stock

    Hi,
    I have a material which is having the stock in "unrestricted Use" , but I want to move the stock to "Quality".
    I have already done the GR for my material.
    Please let me know , how I can put the stock back to the Quality. As I want the stock in the same batch in which its showing the stock in unrestricted.
    If I cancel the GR Document, will the Stock be  moved to the quality after the document cancellation ?
    Please help me to resolve my problem.
    Regards
    Toshi

    hi
    1.pl activate the QM view in the, by extending the QM view from MM01.
    2.IF QM is there already then enter the inspection type 01 for Goods Receipt Insp. for Purchase Order. or if the GR is related to Production then
    04 Goods receipt inspection from production
    3.then cancel the GR or reversr 102 for which you have doen GR already.
    4.Now re do GR, at the time of GR check the  stock type (it should be Quality inspection) the do the posting.
    Before posting to Quality ensure
    1. materia should ahve inpspection plan (QP01)
    with operations assingned with MIC(QS21)
    with out the above master data you cann ot process the quality lot
    -ashok

  • Is there any way to get the apple stock photos as wallpaper? From the iPhone features page?

    I want this picture.
    http://www.apple.com/iphone/features/
    The picture on the black phone next to the 4 inch retina display section. Is there any way to get it? Is it a default photo or wallpaper of iPhone 5?

    It has always been very basic to always maintain a backup copy of your computer/files/docs/pics/music/etc, for just such an occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to maintain a backup ( not good), then you can transfer itunes purchases from an ipod:  File>Transfer Purchases
    Once the music is in itunes on your computer, then you can sync to your iphone.

  • Not getting the weather, stock, calendar widget in the Notification Center, Today's tab in iOS 7

    Can't see any options under Today View in settings for Notification center.

    Rebooted and it all came in !

  • VL10D Unrestricted Stock

    Hi,
    In VL10D transaction, how I can display the unrestricted stock?  When I goto change layout and select unsrestricted field, system is showing unrestricted stock as zero.  I want to display the actual stock in that field.
    Do let me know how to go ahead with this.
    Thanks,
    Deejay

    Hi,
    We can view Unrestricted stock in VL10D.  In VL10D layout, SAP has provided the field for Unrestricted stock, that means we can view the Unrestricted stock in VL10D, and no need to go to CO09 and MMBE for stock check.
    In VL10D, goto userrole tab, there is check box as "with stock data", tick that check box and in layout, select the field unrestricted stock.  You will get the unrestricted stock for supplying plant.
    Thanks,
    Deejay

  • Get the Stock for a given Material no

    Hi,
         I'm an ABAP consultant, new to MM.
         I have a requirement - For a given Production Order I have to find the Material and respective BOM Explosion. Once that is done I have to get the Stock for those Materials [Child Materials].
    I have used AUFK and AFPO to get the material from the Production Order and Used MAST table to get the other details and passed it to FM - 'CS_BOM_EXPL_MAT_V2' - This gives me the Child materials.
    Now I want to know how can I find the Stock for a given Material. I want to get the Overall Unrestricted stock. Which Table do I have to use. Is there any standard Function Module [FM] or BAPI to get it.
    Please help.
    Thanks & Regards,
    Ashish

    I have gone through  the MARD table. I want to confirm - for a Material no there are more than 1 plant and for each plant there are more than storage location. So I have to add the Unrestricted Stock of all those to get the Full Unrestricted Stock.
    Please refer Transaction MMBE - I have to use that output.

  • How to consider unrestricted stock for the run of MRP project?

    Hi every one!
    We are facing a problem using MRP on project stock.
    We would like that the MRP takes unrestricted stock into consideration while calculating quantities to order for project stock.
    For example, a project request 100 pieces of material X.
    We have already 25 pieces of material X in unrestricted stock and 0 in project stock. 
    When I run MRP (MD51), it creates a Purchase Requisition of 100 pieces on the WBS element I have defined and not 75 as expected!!!
    By searching in documents and forums, I have read I have to set the value "2 - Collective requirements only" into the field MRP4 > BOM explosion/dependent requirements > Individual/coll. of the Material Master.
    I have done it but it doesn't change anything.
    Thanks in advance for your support!!!
    Bogdan

    Hello guys!
    As told, here I come with news about my problem.
    Finally, the Strategy Group didn't solve our problem.
    We didn't solve our problem as planned but we have found another way to work.
    Instead of including the unrestricted stock in the MRP project, we use transaction CO46 to have an overview of the unrestricted stock of all the components of the project's BOM.
    Based on that overview, the user can make stock transfers of the available quantities from the unrestricted stock to the project stock.
    I hope it can help people having the same problem!
    Bogdan

  • How to populate " UnRestricted Stock" key figure from 0IC_C03

    Hello All,
    There is requirement for us to show a field known as "unrestricted stock" from the info cube 0IC_C03. but there is no such key figure in that info cube. I searched all the forums and learnt that it must be calculated on fly while the report executes.
    can any body help to identify / populate the "Un Restricted Stock"  from the info cube 0IC_C03.
    Thanks for all your time

    Hello Mr.Nagaraju vadlamani,
    Thanks for your reply.
    Can you please let me know how to get the following objects you mentioned to calculate the "unrestricted stock"
    Projected Stock of today - ?
    Demands with demand date today - ?
    receipts with delivery date today  - ?
    Thanks,

Maybe you are looking for

  • How to download a file under link in FF?

    there is a 'save target as...' popup menu option in "big" firefox, which I use to skip default action for specific files. I.e. to download a pdf file to read it later instead of open it in acroread right now. How can I get the same function in mobile

  • BUG REPORT: iPad Safari glitch and Fedex' website problem? HELP!!!!

    Okay, I've discovered a weird bug and I don't know how to fix it, but you should definitely check this one out so you don't get the same problem... I recommend you DON'T try following this on your iPad, otherwise you'll also experience the error, and

  • Thor digital copy not working?

    Hi I bought the movie Thor today. I loaded the digital copy disk into my PC and redeemed the code as I have done many time before. The only thing is this time the movie downloaded ok and when I click on the movie tab i see it there but it will not pl

  • Xp wont read ipod at all

    so somebody sold me this little nano 2 gb said it work i was like cheap had to go get a charger for it charged fine works great but my computer when i plug it in nothing pops up i have the latest itunes i was even going to like reset it but says need

  • Random cannot find root device at boot

    Every so often when I boot my arch install I get the error saying that it cannot find my root device.  After a reboot sometimes everything is fine other times it will will repeat.  It seems to be about a 40-60 chance that the error will occur.  This