Calculate stock of material on a particular date ..very urgent (have points

Hi all,
My requirement is to calulate stock of a material on a particular date..
See.
I need a function mudule that will accept..
matnr, date, werks....n give me stock as output..
Please help me reg. this..
Have ur points...

hai pradeep,
As there is no function module as u said but u can create the function moudule as per ur requimrent in SE37. Just you need the tables from where you want the stock and from which you are giving matnr, date and werks.
Take the import paramters as matnr, date and werks and export parameter as stock. In source code write the select qurey depending up on the input. i think u know how to write the qurey depending up on the tables from where you want the stock .
hope this will help you.
<b>reward if useful</b>
regards,
sunil kairam.

Similar Messages

  • How to get a opening stock of a material on a particular date

    Hi,
    Could you pls provide me the logic of how to get the opening stock of the material on a particular date. I searched the forum and found the logic to fetch the closing stock at a given period but not for a date.
    An immediate response would be really appreciated.
    Thanks
    Harris

    Dear,
    Please read following part of my code
    FORM GET_OPENING .
       IF IT_FINAL[] IS NOT INITIAL.
         SELECT *  FROM MARD
           INTO CORRESPONDING FIELDS OF TABLE IT_MARD
           FOR ALL ENTRIES IN IT_FINAL
           WHERE MATNR = IT_FINAL-MATNR
           AND   WERKS = '1000'.
         SELECT A~MBLNR A~MJAHR A~BUDAT B~WAERS B~ZEILE B~BWART B~MATNR B~WERKS B~LGORT B~CHARG B~SHKZG B~MENGE B~MEINS B~BUSTM B~XAUTO
           INTO CORRESPONDING FIELDS OF TABLE IT_MKPF
           FROM  MKPF AS A JOIN MSEG AS B
           ON A~MANDT = B~MANDT
           AND A~MBLNR = B~MBLNR
           AND A~MJAHR = B~MJAHR
           FOR ALL ENTRIES IN IT_FINAL
           WHERE B~MATNR = IT_FINAL-MATNR
           AND   A~BUDAT GE P_BUDAT-LOW
           AND   B~WERKS = '1000'.
       ENDIF.
       AKTDAT = SY-DATLO + 30.
       IF NOT ( P_BUDAT-HIGH IS INITIAL OR P_BUDAT-HIGH > AKTDAT ).
         LOOP AT IT_MKPF INTO WA_MKPF WHERE BUDAT > P_BUDAT-HIGH.
           MOVE-CORRESPONDING WA_MKPF TO IT_MKPF1.
           APPEND IT_MKPF1.
           DELETE IT_MKPF.
         ENDLOOP.
       ENDIF.
       SORT IT_MKPF1 BY WERKS MATNR SHKZG.
       LOOP AT IT_MKPF1.
         IF ( IT_MKPF1-XAUTO IS INITIAL ) OR
             ( IT_MKPF1-BUSTM <> 'MA02' AND  IT_MKPF1-BUSTM <> 'MA05' ) .
           MOVE-CORRESPONDING IT_MKPF1 TO IT_MAT.
           COLLECT IT_MAT.
         ELSE.
           DELETE IT_MKPF1.
         ENDIF.
       ENDLOOP.
       SORT IT_MKPF BY WERKS MATNR SHKZG DESCENDING.
       LOOP AT IT_MKPF INTO WA_MKPF.
         IF ( WA_MKPF-XAUTO IS INITIAL ) OR
            ( WA_MKPF-BUSTM <> 'MA02' AND
            WA_MKPF-BUSTM <> 'MA05' ).
           MOVE-CORRESPONDING WA_MKPF TO T_MAT.
           COLLECT T_MAT.
         ELSE.
           DELETE IT_MKPF.
         ENDIF.
       ENDLOOP.
       LOOP AT IT_MARD.
         CLEAR IT_MAT-MENGE.
         MOVE-CORRESPONDING IT_MARD TO FINAL.
         READ TABLE IT_MAT WITH KEY WERKS = IT_MARD-WERKS
                                    LGORT = IT_MARD-LGORT
                                    MATNR = IT_MARD-MATNR
                                    SHKZG = 'S'.
         FINAL-ENDMENGE = IT_MARD-LABST + IT_MARD-INSME + IT_MARD-SPEME + IT_MARD-EINME + IT_MARD-RETME - IT_MAT-MENGE.
         CLEAR IT_MAT-MENGE.
         READ TABLE IT_MAT WITH KEY WERKS = IT_MARD-WERKS
                                    LGORT = IT_MARD-LGORT
                                    MATNR = IT_MARD-MATNR
                                    SHKZG = 'H'.
         FINAL-ENDMENGE = FINAL-ENDMENGE + IT_MAT-MENGE.
         COLLECT FINAL.
       ENDLOOP.
       LOOP AT FINAL.
         CLEAR T_MAT-MENGE.
         READ TABLE T_MAT WITH KEY WERKS = FINAL-WERKS
                                    MATNR = FINAL-MATNR
                                    SHKZG = 'S'.
         MOVE T_MAT-MENGE TO FINAL-SOLL.
         CLEAR T_MAT-MENGE.
         READ TABLE T_MAT WITH KEY WERKS = FINAL-WERKS
                                    MATNR = FINAL-MATNR
                                    SHKZG = 'H'.
         MOVE T_MAT-MENGE TO FINAL-HABEN.
         FINAL-ANFMENGE = FINAL-ENDMENGE - FINAL-SOLL + FINAL-HABEN.
         MODIFY FINAL.
       ENDLOOP.
       LOOP AT FINAL.
         WA_FINAL1-MATNR = FINAL-MATNR.
         WA_FINAL1-MEINS = FINAL-MEINS.
         WA_FINAL1-OP_MENGE = FINAL-ANFMENGE.
         WA_FINAL1-RE_MENGE = FINAL-SOLL.
         WA_FINAL1-IS_MENGE = FINAL-HABEN.
         WA_FINAL1-CL_MENGE = FINAL-ENDMENGE.
    *  WA_FINAL-LGORT = FINAL-LGORT.
    *    READ TABLE IT_MAKT WITH KEY MATNR = FINAL-MATNR.
    *    MOVE IT_MAKT-MAKTX TO WA_FINAL-MAKTX.
         APPEND WA_FINAL1 TO IT_FINAL1.
       ENDLOOP.
    ENDFORM.                    " GET_OPENING

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

  • Table to get "stock of material on a past date "

    Hi Guru's,
    Can anyone tell me "how to get stock of material on a past date".
    Pls tell me from which Table you can fetch these values and in what logic.
    Any Input is highly appreciated.
    Thanks and Regards,
    Selva

    Hello,
    You can get the stock from the table MARDH, MCHBH period wise.
    this table is use for history stocks.
    Regards
    Bhima

  • Stock in transit on a particular date

    Hi Gurus,
    Can you please tell me how to take stock in transit on a particular date (past date and not on current date).
    Thanks & Best regards

    hi
    Check thease reports
    Use MB5T - for Stock in transit
    You can use MB52 also which will display the materials in transit based on group.
    V_UC_7 - Incomplete Inbound Deliveries
    VL06I - Inbound Delivery Monitor
    VL06IG - Collective Processing Via Inbound Delivery Monitor
    Regards
    Vishal

  • Stock in transit for a particular date

    Hi all,
    How to find the stock in transit for a particular date.
    In MB5T date option is not available.
    Is there any other way or i need to gofor Z development.
    Kindly help me in this regard.
    Regards
    KK

    Try MB5TD. Please also check OSS notes 1120843, 1268193, 925384.
    Edited by: Csaba Szommer on May 22, 2009 8:28 AM

  • Material Stock at storage location for particular date!

    Dear Friend,
    I need a table or bapi which gives stock for particular storage location on particular day. That is MMBE and if you go into detail list (shift+f7). I want same thing.
    I have tried in MARD table, but it gives stock of a material for most current date.
    Waiting for your early Reply.
    Regards,
    Bhavin Shah

    hi check:
    MB_ADD_PURCHASE_ORDER_QUANTITY
    Regards
    Ashok P

  • Stock value and qty on particular date.

    Hi All.
    Could you  you guide me in which transcation I will get the report of existing stock value and qty for a particular valution class  on particular date like 15 Apr 2009.There is a transaction MB5B similar to my requirement  but there is no Valuation class as selection.
    Thanks in Advance
    Regards
    katta

    Hi,
    You can get valuation class data thru MC.9 or MC.1  but problem is it is for month only
    If you want to go for particular material analysis than use MB51 from go live to till date or MB5b with storage location selection
    Regards,
    Chetan Mistry

  • Storage location stock with value on a particular date

    i m in search of a report or logic which can fetch stock as in mb5b on a particular date. mb5b shows sloc stock but without value and show valuated stock without sloc. can anyone help me out to find such report or give some logic or table from where it can fetch sloc stock with value.
    Edited by: Husain Husain on Jan 28, 2010 4:00 PM

    Hi,
    All the stock related reports like MC.1,MC.5,MCBA etc will give you stock for a particular months range. he only report giving stock on a date is MB5B .However in this report you will not get the storage location stock value.
    Now try the report in T Code J3RFLVMOBVED which will serve your purpose .Here in the material parameter tab give your storage location and the date range in the main tab Posting date range and than execute.
    Dhruba

  • Stock/requirement list at a particular date

    MD04 gives current stock/requirement list and MD05 gives planning result of last MRP run.
    Hoe to see stock/requirement of a particular date

    Dear Harshad,
    As explained there is no standard report to meet this requirement,but stock on a posting date is possible through MB5B.
    If my understanding is correct then this stock/requirements list is a dynamic one(even on a particular date) this list gets updated
    for each fixed/planned- receipts/issues.So on the same day there may be number of updated list.So there cant be only one
    stock/requirements list on a given particular date.
    Correct me if I'm wrong.
    Regards
    Mangalraj.S

  • Duplicate records found while loading master data(very urgent)

    Hi all,
    One infopackage in the process chain failed while laoding the master data(full update).Its showing the following error-->duplicate record found ..1 record used in /BI0/PTCTQUERY and the same record occured in /BI0/PTCTQUERY tables.
    can anyone give me the solution...its very urgent...
    Thanks & Regards,
    Manjula

    Hi
    You can see the check box in the Processing tab page. Make a tick mark for the check box Ignore Duplicate Data Records indicator . When multiple data records that have the same key are transferred, the last data record in the request is updated to BI. Any other data records in the request with the same key are ignored.
    Help says that:
    To maintain consistency, ignoring duplicate data records is only possible if the data is updated serially. A serial update is when data is first updated into the PSA then, after it has been successfully written to the PSA, it is updated into the master data or text tables of the InfoObject.
    If a DataSource transfers potentially duplicate data records or if you manually set the Ignore Duplicate Data Records indicator, the PSA Only update type is automatically selected in the scheduler.
    hope it clears ur doubt, otherwise let me know.
    Regards
    Kiran

  • SQL Loader Oracle 10g problem in upload date with time data -- Very urgent.

    Hi
    I am trying to upload data using SQL loader. There are three columns in the table
    defined as DATE. When I tried upload a data like this '2007-02-15 15:10:20', it is not loading time part. The date stored as 02/15/2008' only. There is not time on that. I tried with many different format nothing work. Can please help me ?
    I have also tried with to_date --> to_timestamp it did not work.
    The application is going to be in production, I cannot change DATE to TIME STAMP. This is very urgent.
    LASTWRITTEN "decode(:LASTWRITTEN,'null',Null, to_date(:LASTWRITTEN,'YYYY-MM-DD HH24:Mi:SS'))",
    CREATEDON "decode(:CREATEDON,'null',Null, to_date(:CREATEDON,'YYYY-MM-DD HH24:Mi:SS'))",
    LASTUPDATEDON(21) "decode(:LASTUPDATEDON,'null',Null, to_date(:LASTUPDATEDON(21),'DD/MM/YYYY HH24:MI:SS'))"

    Your problem is most likely in decode - the return type in your expression will be character based on first search value ('null'), so it will be implicitly converted to character and then again implicitly converted to date by loading into date column. At some of this conversions you probably are loosing your time part. You can try instead use cast:
    SQL> desc t
    Name                                      Null?    Type
    LASTWRITTEN                                        DATE
    CREATEDON                                          DATE
    LASTUPDATEDON                                      DATE
    SQL> select * from t;
    no rows selected
    SQL> !cat t.ctl
    LOAD DATA
    INFILE *
    INTO TABLE T
    TRUNCATE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    LASTWRITTEN
    "decode(:LASTWRITTEN,'null',cast(Null as date),
      to_date(:LASTWRITTEN,'YYYY-MM-DD HH24:MI:SS'))",
    CREATEDON
    "decode(:CREATEDON,'null',cast(Null as date),
      to_date(:CREATEDON,'YYYY-MM-DD HH24:MI:SS'))",
    LASTUPDATEDON
    "decode(:LASTUPDATEDON,'null',cast(Null as date),
      to_date(:LASTUPDATEDON,'DD/MM/YYYY HH24:MI:SS'))"
    BEGINDATA
    2007-02-15 15:10:20,null,null
    null,2007-02-15 15:10:20,null
    null,null,15/02/2007 15:10:20
    SQL> !sqlldr userid=scott/tiger control=t.ctl log=t.log
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Feb 29 00:20:07 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 3
    SQL> select * from t;
    LASTWRITTEN         CREATEDON           LASTUPDATEDON
    15.02.2007 15:10:20
                        15.02.2007 15:10:20
                                            15.02.2007 15:10:20Best regards
    Maxim

  • Report on Stock Vs VAlue on one particular date,

    Dear All,
    Is ther any Table or Functional Module Or BAPI ,if I pass the material /Plant/St.location and any date,which will give the output of Stock and Value?

    Hi
    Thanks for reply.But I want to pass the date /plant/St.loc and material.But the table MCHb not useful.
    Ex:
    Input:
    Material:123456
    Plant:1000
    st.loc:RM01
    Date:01/01/2007
    I want the Out put like,
    Valuated Stock and
    Value

  • Mask a particular column - very urgent

    Hi Team,
    I am using Oracle 10g, But i have only schema level access.
    How to mask the sensitive data in Columns like Salary Name,Bank account can be updated with a different values...like XXXX ?.
    Thanks in Advance
    Regards
    FEnto

    You should encrypt that column
    Please refer to this thread for more information about encryption of the column
    How to encrypt column of some table with the single method ?
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • Convert datetime to date/very urgent

    Hello experts
    i am new to sql server and wants to change a column data type datetime to date in a view and i need to document that also, thank you.

    CAST or CONVERT the datetime column to Date:
    eg:
    Select Cast(column as date) from table

Maybe you are looking for

  • Report Server service problem

    Hi all champions. I have installed 9iAs R1 on windows 2k.My form server is running well, but there is a problem with Report server and its service is not ruuning (error 186). What could be the tns entry for folders 806 and iSuites? Early reply will b

  • How can I add a SHARED Outlook Calendar to my iPhone?

    I have Outlook for work. I have my personal calendar on there, along with my work calendar which is shared with my boss. When I sync my IPhone to Exchange, my personal calendar from Outlook syncs to my phone. The Shared calendar does not appear, howe

  • How does apex detect the MIMETYPE of an upload?

    Hello, I need to import a bunch of files from the OS filesystem to my own table (blob). For implementing the download of these files I need to know the mimetype. Now, the files are stored in my table, but I have no clue how to detect the mimetype of

  • Exchange rate for FI postings in Billing

    Dear Experts, Can Exchange rate for FI postings in Billing be determinated by the Pricing date instead of the billing date when we create it? Br Sophie

  • Buffer Hit % ?

    Hi Guys, My DB Buffer Hit % (from awr): is very low 69% (9am to 6pm daily). Is this ratio a good indicator for me to increase my db cache? (<90%) I have read several articles. Some suggest that it's a good indicator and some suggest not. Anyone can g