Stock for SC

Hi experts,
Senerio like this... If i am entering vendor no and posting dates 20.11.2008 to 1.12.2008 so i need all the
material in between this period and their respective closing balance. so plz check the query given below.
if any FM to get previous period Special stock for Subcontracting so plz tell me.
DATA : L_BUDAT TYPE BUDAT,
H_BUDAT TYPE BUDAT,
OPBAL TYPE MENGE_D,
TEMP TYPE MENGE_D.
DATA : IT_MSEG1 TYPE STANDARD TABLE OF MSEG,
WA_MSEG1 TYPE MSEG.
REFRESH IT_MSEG[].
REFRESH IT_MKPF[].
SELECT MBLNR
BWART
ZEILE
MATNR
LIFNR
WERKS
LGORT
SHKZG
SOBKZ
MENGE FROM MSEG
INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
FOR ALL ENTRIES IN IT_FINAL
WHERE MATNR = IT_FINAL-MATNR AND
LIFNR = IT_FINAL-LIFNR AND
( BWART = '541' OR
BWART = '542' OR
BWART = '543' OR
BWART = '544' OR
BWART = '548' OR
BWART = '549' ) .
*L_BUDAT = PODATE-LOW - 1.
*H_BUDAT = PODATE-HIGH - 1 .
SORT IT_MSEG BY BWART MATNR.
IF NOT IT_MSEG[] IS INITIAL.
SELECT MBLNR
BUDAT FROM MKPF
INTO CORRESPONDING FIELDS OF TABLE IT_MKPF
FOR ALL ENTRIES IN IT_MSEG
WHERE ( BUDAT < PODATE-LOW ) ****check here********
AND MBLNR = IT_MSEG-MBLNR.
ENDIF.
IT_MSEG1] = IT_MSEG[.
REFRESH IT_MSEG[].
IF NOT IT_MKPF[] IS INITIAL.
SELECT MBLNR
BWART
ZEILE
MATNR
LIFNR
WERKS
LGORT
SHKZG
SOBKZ
MENGE FROM MSEG
INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
FOR ALL ENTRIES IN IT_MKPF
WHERE MBLNR = IT_MKPF-MBLNR AND
( BWART = '541' OR
BWART = '542' OR
BWART = '543' OR
BWART = '544' OR
BWART = '548' OR
BWART = '549' ) .
ENDIF.

Hi Vishal,
If you need all the material documents between the dates entered on the selection screen, then you should be using the 'IN' operator and not the '<' operator.
Thanks
Nidhi

Similar Messages

  • Reg:Opening and Closing Stock For Plant

    Hi All,
      i want to calculate the opening stock and closing stock for plant wise for the given Posting Period Date.
    Am having the opening balance and closing balance for all months but i need it as month wise.
    considering this example,
    the date is from 15.01.2010 to 15.03.2010 and for one plant
    considering this example,
    am having the opening stock from as 15.01.2010  to 15.03.2010 as 10,000 and the closing stock as 15,000.
    but i need in month wise like below,
    from 15.01.2010 to 31.01.2010 what is the opening stock and closing stock?
    from 01.02.2010 to 28.02.2010 what is the opening stock and closing stock?
    from 01.03.2010 to 15.03.2010 what is the opening stock and closing stock?
    this is purely based on plant wise and not material wise?
    could anybody say clearly how can i acheive this scenario?
    i have referred MB5b,mc.9 transaction programs but still confused how to go with plant wise for a particular period?
    Thanks & Regards,
    Suresh
    Edited by: suresh suresh on Mar 24, 2010 10:15 AM

    Hi,
    Refer to link below:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c1/3766e7449a11d188fe0000e8322f96/frameset.htm
    Regards,
    Venkat.

  • Material opening and closing stock for a given day- Tables or FM

    Dear Friends
             i have to make a report  , related to Material opening and closing stock for a given day  , i check the T-Code- MB5B ,
    it is not giving correct date . is any functional module is available  ? . i checked some table like mbew , mard . it is also not giving correct requirement . Please help

    Hi
    Goto transaction MC.9, Give your Material and,Plant and the date which you need to know the closing stock. Do make sure that in the high and low values you are giving the same date there. I guess no such FM are available for this. You can refer the  [Link|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=15856]  for some help.
    Regards
    Vinodh
    Edited by: Vinodh_AN on Dec 15, 2010 9:19 AM
    Edited by: Vinodh_AN on Dec 15, 2010 9:25 AM

  • CLOSING STOCK FOR A GIVEN PERIOD

    hi all,
    I have to design a report to find out the closing stock.How to find out closing stock for say 1st nov to 15th nov.In MBEW and MCHB , i am getting closing stock as on date. please help me out if there are any tables or any other way out through function modules.
    Regards,
    Devina

    hi,
    I will check that t code.
    thanks and regards,
    Devina

  • Batch wise stock for a Purchase order

    Here, i am receiving the goods from the customer for jobwork, while receiving the material (cloth) itself i wont receive the design what i have to print on the material.(For eg customer will send me some 5000 mtrs, he wont mention the design for that. but we have to give a lot number for the whole 5000 mtrs, then after 1 week he will give design for 2000 mtrs. and also he will tell 2000 mtrs 4 colors i have to divide that 2000 mtrs into 4 different batches and i have to bring it in to stock. and also i have to see the report that customer issued 5000 mtrs and for 2000 mtrs he had given program remaining 3000 mtrs he has to give program(Design)).
    what i did is i created new doc type in PO (customer Cloth Receipt)
    I made number range for that doc type as what they are currently maintaining now (so that number will be lot number, it will be the identification for that customer to track the material what he have supplied)
    i created the new output type so that i can give the printout as an acknowledgement to customer
    i created the customer as vendor
    i did inbound delivery for that material what i have received (5000 mtrs) from customer(Vendor)
    when i receive the program(design) for 2000 mtrs 4 different batches
    i did GR against the inbound delivery so that while doing GR i can create 4 different batches and i can bring that 2000 mtrs into stock.
    Pls guide me some steps where i can make this process simple......

    Hi Jurgen,
    Thanks for your reply. I am not looking for any analysis report or LIS report.
    i am looking for simple ageing report for a date entered by the user. I got the logic and tables for the current date but if i need to refer the stock ageing of previous date like my stock ageing at 30-06-2010. I am not able to get any tables where i can have the batch stock for a given date or a month.
    The report output format to be
    stock <=30 days
    stock>30 and <=90
    stock>90 and <=180
    stock>180 days
    The criteria for calculation will be the date entered by the user in the input screen. If the user enters the date as 30-06-2010 then all the stock received in the month of june and still lying in my storage location will fall the category <=30 and display in the report.
    Stocks received in the month of march, april and may will fall under the category "stock >30 and <=90".
    If I can get the batch wise stock for a particular month , I can pick the posting date of the Goods receipt from the batch number and calcuate my ageing (i.e date entered in the input scren of the report 30-06-2010 - batch posting date).
    I am also referring to the note which you have sent but in the mean while if you can help me to identify the tables where I can get the batch stock for a particular month.
    Thanks
    Fazal.

  • Tables/FM for opening/closing stock for material on given posting date

    Hi All,
    I had requirement of find the opening/closing stock for material on given posting date. The values we can find out using TCode - MB5B.
    But I cannt use MB5B to extract data because I need to find detials for thousands of material.
    Can you please adivce if their is any FM or tables through which i can find this detial on any given date apart from current date.
    Thanks & Regards,

    Hi,
    [https://forums.sdn.sap.com/click.jspa?searchID=19631709&messageID=6593903]
    [https://forums.sdn.sap.com/click.jspa?searchID=19631709&messageID=6630975]

  • Batch wise stock for a given period or month

    Hi,
    My company wants to implement stock ageing report in MM.
    We manage the stocks in Batches. For us the main criteria for stock ageing is batch creation date.
    The report should run stock ageing based upon the date range given as an input screen
    For ex : date range in input can be of today or as of 30.06.2010.
    If the report is run as of today then I am able to get the batch stock from table MCHB . Quantity from field "CLABS"  and the batch creation date from the field "ERSDA"
    But if the report to be run as of 30-06-2010. Then I am not able to get the data from MCHBH as of 30.06.2010.
    I have checked for one material in the table and as per stock it should be 351 as of 30-06-2010 but in the MCHBH table for the month 06. year 2010 it is showing as 136 pcs only.
    As our LIS tables are not getting populated correctly I am not able to check those tables too.
    Can any one guide me with the logic or the table where I can get the batch stocks for a particular month.
    I need Material, Batch, Quantity month and year .
    Please advice how can i get the data and from which table.
    Thanks you for your support in advance.
    Regards
    Fazal

    Hi Jurgen,
    Thanks for your reply. I am not looking for any analysis report or LIS report.
    i am looking for simple ageing report for a date entered by the user. I got the logic and tables for the current date but if i need to refer the stock ageing of previous date like my stock ageing at 30-06-2010. I am not able to get any tables where i can have the batch stock for a given date or a month.
    The report output format to be
    stock <=30 days
    stock>30 and <=90
    stock>90 and <=180
    stock>180 days
    The criteria for calculation will be the date entered by the user in the input screen. If the user enters the date as 30-06-2010 then all the stock received in the month of june and still lying in my storage location will fall the category <=30 and display in the report.
    Stocks received in the month of march, april and may will fall under the category "stock >30 and <=90".
    If I can get the batch wise stock for a particular month , I can pick the posting date of the Goods receipt from the batch number and calcuate my ageing (i.e date entered in the input scren of the report 30-06-2010 - batch posting date).
    I am also referring to the note which you have sent but in the mean while if you can help me to identify the tables where I can get the batch stock for a particular month.
    Thanks
    Fazal.

  • Opening stock for stock provided to vendor

    Hi Gurus,
    I m trying to get opening stock for stock at subcontracter. I m using 0TOTALSTCK in the Query and I'm getting wrong values as compare with MB5B. I dont know how to show the opening stock and closing stock in the Query for this special stock (the indicator is "O").
    MB5B is showing opening stock when you select the special stock and enter the date, but in my Inventory Cube and Query i see something else. I checked the initilisaiton and movements in the cube, everything is OK.
    But still my Query is getting wrong values.
    Could you help me to find out?
    Thanks,
    Zeynep

    hii
    In BW cube does not have the field of Opening stock or closing stock as it works on the function module at the background.
    U will get the closing stock in the query designer as the TOTSTOCk field name. Also u have the receipt & issue field there. So u can calculate the Opening Stock figure by using the Formulae & these available fields.
    Thanks
    Neha

  • 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.

  • T Code for Project Stock for a particular period

    I want to check my project stock for a particular period, is there any Standard T Code, if not how to find the solution. Please revert me the solution.
                                                                                    Thank you.

    Hi
    Please check the following Report
    S_P00_07000140 - Inventory and Raw Material for Special Stock Report
    To access the report, from the SAP Easy Access menu, choose Accounting >> Financial Accounting >> General Ledger >> Reporting >> Tax Reports >> Thailand >> Inventory and Raw Material for Special Stock Report
    OR
    please try to create a Query by using the following tables..
    MSPR
    MARA
    MAKT
    Tnx.
    Abdul

  • Valuated stock for a certain period

    Hi all,
    Using transaction MC.9 (Material Analysis: Stock), you can search for a material for a certain period (ea. 04.2007). The outcome gives you the Valuated Stock for that period.
    In which table is this Valuated stock stored?
    How can I fetch this Valuated Stock (through table, BAPI, ...?
    Many thanks in advance.

    Hi,
    Reading data from MBEWH is tricky since as you correctly pointed out there may not be any record in MBEWH for a particular period.The logic for creating a record in MBEWH is for first relevent entry in the current month create a history record in MBEWH i.e. e.g. if there is a say GIR or any stock movement today & if this happens to be the first entry for materialValuation area then it will create a record in MBEWH for the previous period i.e. 2008/03. Now suppose there is no movement at all say for the period 2008/04 & say 2008/05 materialValuation area in that case as per the above mentioned logic for the first record of the materialVal area for the period 2008/06 it will write a record for 2008/05 but there will be no record for the period 2008/04.so to get the currect valuated stock get all records for materialval area into an internal table where
    period i.e YYYYMM is GE period under consideration. Then sort the internal table on matnrbwkeybwtarlfgjalfmon. Then loop at the internal table & if you hit the first record pick up the stock i.e the stock you are interested in & exit from the loop. However if no record is found in the internal table get the details directly from MBEW. & that's it. You may refer to SAP help for the same. (search for MBEWH)
    I hope this helps,
    Regards,
    Raju Chitale

  • How to calculate Opening Stock for a particular date.

    Hi Experts,
    I have a sitution to calculate Opening stock for a particular date.
    please help me with the necessary Fields & Tables required.
    Appriciate If any Sample coding available.
    Thanks & regards,
    Venkat.

    Hi Venkat,
    To Calculate Opening Stock & Closing stock there are different procedures.
    It just depends of\n the client requirements & usage of the material.
    For example, we have different types of stocks, like, Through Pipeline, Special, Unristricted, quality, safety,
    and many types of stocks.... so all these types are indicated in MSEG tabe in SOBTZ field,...
    Now Comimg to your Query, You need to calculate OPENING & CLOSING STOCK.
    We have a similiar standard report in MB5B Tcode..
    to get the same results in your report do like this...
    For valuated stock go to the MARDH, MBEWH, MCHBH tables But I Prefer MBEWH.
    here in MBEWH give the month & year and you get the result in LBKUM field...
    For Special stock, You need to go to another table like MKOLH,,(I forgot still 2 more) and
    give the month & year inputs and you will get the result in SLABS field.
    and remaining MB5B refers to its deetails lists with different Movement types,
    whcih you can get clearly from MSEG Table...
    Hope you can write the select Queries accordingly.
    Thanks & Regards,
    Dileep .C

  • Valuated sales order stock for configured material

    Hi All!
    I have a small problem   : I created a new type of material (OMS2) - a configurable one, managed on quantity and value basis. I work with valuated sales order stock for configurable materials but the account in the purchase requisition is determined by means of event key GBB insted of event key BSX.
    Where is my error?
    Any idea would be appreciated.
    Florina C

    Hi
    I think you are talking about Special Stock "E"...ie) Sale Order Stock...
    If my understanding is correct then,
    If you go and see the Table T156....For the
    Movement Type: 101,
    Special stock Indicator : E,
    Qty. Updation Checked,
    Val. Updation Checked,
    Movement Indicator : Against PO,
    Consumption Indicator: Sales Order Stock.....combination....the transaction Event Key....GBB only has been Assigned....these  settings you cannot change...
    This linkage you can view in OLMW-----> Account Determination -
    > Acc. Determination W/O Wizard -
    >Account Grouping....also
    Reward if useful
    Regards
    S.Baskaran
    Edited by: baskaran srinivasan on Dec 20, 2007 12:18 PM

  • How to load stocks for the months prior to initialization ?

    Hello,
    We load a cube stock from 3 ODS for BF,BX and UM extractors.
    We are in a monthly snapshot scenario(we have read the specific how to but we must use 3 ODS one for each datasource because of data integrity (strong customer architecture contrainst).
    For opening stock and the future month the solution is ok.
    How to load the data for the 12 month prior the loading of opening stock ?
    Specific datasources, full loading ?
    Thanks to share our experiences
    Best regards
    Christophe

    your previous months closing stock becomes opening stock for current month. Try the infostructure S039,this holds the closing stock of each month. You can populate this infostructure with program rmbs039. create a generic data source on this and populate opening and closing stock for each month.

  • Calculation of consignment stock for a material ( ABAP/MM)

    HI,
    I need information to find out consignment stock as per requirement. I doubt the requirement is not complete enough but they dont agree. I am using following logic.Please provide me your inputs.( i was asked to follow standard program logic of 'RM07MLBD')
    1.I am retrieving material document no.s from MSEG with the movement types 631,632,633,634,701,702 and SOBKZ = 'W' for a particular reporting period for a material.
    2. I filter them by checking date BUDAT in MKPF.
    3. then i aggregate them taking SHKZG = 'S' or 'H' accordingly '+ ' or '-'.
    And finally i Aggregate them for customers belonging to same state (REGIO)
    but i am getting some negative values and incorrect entries.
    what i am not able to understand is whether my selection criterion is wrong or aggregation of materials is wrong or if i am missing any other selection criterion? Your inputs are highly appreciated.
    Thanks in Advance.
    Shrini

    Hi ,
           Follow sample program RM07MKBS OR MB54 which display consignment stock for  am material.
    Please reward if useful.

  • Negative stock  for storage location M7 021

    Hello
    I use negative stock for some materials
    When I want to post document in MIGO - 551 scrapping, I have error message M7 021: Deficit of BA Unrestricted-use 1.100 EA:   24000641 XXXX 9999 YYYYYYY
    This is ERROR. When I change storage location from 9999 to 0002 message have status WARNING.
    I set - allowed negative stock in material master data MM02 and for plant in WB02
    Where should I set "allowed negative stock" for storage location, because I need warning for location 0002?
    Could You help me?
    Thank You in advance
    Arek

    Go to SPRO>MM>IM>Goods Issue/Transfer posting>Allow negitive stock allowed for plant and then chose the plant and then go for the storage location --> mark the same.
    If use ful award points

Maybe you are looking for

  • Is planned delivery time is considered in scheduling agreement ????

    Hi experts problem is that the schedule lines (for external procurement) generated from MRP are not taking the "" Planned delivery time into consideration"". System is only taking the G.R processing time. I have mentioned the Planned delivery time in

  • My Network settings are being changed by another program??

    When i open up system preferences>network an alert window pops up to say "your network settings have been changed by another program"...so naturally i click the 'o.k' button to get rid of it, but it immediately pops up again. So its impossible to mak

  • Error in ABAP routine

    Hi, I am facing the error ''Global planning sequence was terminated with errors'' in the process chain what is the reason behind that and how to solve this. Is it because of lock entry?

  • My iTunes won't open after partial upgrade.

    Hello, I recently tried to download the latest version of Itunes but got a message during the middle of download saying I didn't have enough memory to complete it. I immediately hit cancel and now my Itunes won't open! Everytime I try to open it I ge

  • Ie Spry Menu help

    Hey guys, Im building a site with a spry menu on the left hand side. It looks good in Safari but the dimensions are bad in ie. Can you tell me what I'm doing wrong? www.thecorpsofexcellence.org Thanks for your help! kcd