Date Parameters in Stock Aging Report

Dear Experts,
Can anybody help me how to include the date paramaeters like FromDate and ToDate in the below query. I need the Stock againg in b/w two dates.
SELECT distinct T0.ITEMCODE , T1.[ItemName], T0.WhsCode , T0.ONHAND as 'Total Qty', 
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE())<30 THEN T0.ONHAND END '<30 Days(Qty)',
CASE WHEN DateDiff(day, T1.LASTPURDAT,GETDATE()) >=30  AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 60 THEN T0.ONHAND END '60 Days(Qty)' ,
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 60 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 90 THEN T0.ONHAND END ' 90 Days(Qty)',
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 90 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 180 THEN T0.ONHAND END '180 Days(Qty)',
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 180 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 360 THEN T0.ONHAND END '360 Days(Qty)'
FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode and T0.ONHAND >0
Regards,
Srinivas

Hi Srini........
Try this........
SELECT distinct T0.ITEMCODE , T1.ItemName, T0.WhsCode , T0.ONHAND as 'Total Qty',
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE())<30 THEN T0.ONHAND END '<30 Days(Qty)',
CASE WHEN DateDiff(day, T1.LASTPURDAT,GETDATE()) >=30 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 60 THEN T0.ONHAND END '60 Days(Qty)' ,
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 60 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 90 THEN T0.ONHAND END ' 90 Days(Qty)',
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 90 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 180 THEN T0.ONHAND END '180 Days(Qty)',
CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 180 AND DateDiff(day, T1.LASTPURDAT,GETDATE()) < 360 THEN T0.ONHAND END '360 Days(Qty)'
FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode Inner Join OINM T4 On T0.ItemCode=T4.ItemCode
Where (T4.DocDate>='[%0]' and T4.DocDate<='[%1]') and T0.ONHAND >0
Regards,
Rahul

Similar Messages

  • Stock Aging report with current date

    Dear Experts
    Can we able to take stock aging report with current date?
    Thanks&Regards,
    Vinoth Raj K

    You're posting in the Portuguese B1 space.
    You might want to post in the English one: SAP Business One Application

  • Urgent: Regarding Stock Ageing report

    hi,
    i want to have stock ageing report in which i want to have the deatils :-
    This is the material which is present in the palnt from dis <b>date</b> and further details of it consumption. plzz tell the <b>tcode</b> for it.
    plzz help me out as it is most urgent to me..
    regards,
    ric.s
    Message was edited by:
            ric .s

    Hi
    The report MC.9 shows Last movement date/Last receipt date / Last issue date.
    In period to analyze give appropriate date range
    Or
    check  MSEG & MARD table to get details about material documents with date
    Vishal...

  • Stock ageing report

    Hi all,
            I am developing stock ageing report i would not able to find Below fields in existing cube, kindly guide me how i can get those fields data in BI. whether i can create generic extraction or ? please give yr suggestion.
    Fields:
    vendor sub range
    consignment no
    Return flag(Returnable)
    And also GR data and GR qty already data availble how to find last GR date based on user input.Please sugges me.
    Last GR date  
    Last GR qty
    Thanks & Regards,
    R. Saravanan

    Try extractor 2LIS_03_BF. Or table MSEG.

  • Facing Issue with Stock Ageing report

    In Blocked Stock Ageing report Output, I am facing following issues
    1. Stock is correct but once we include the "Reason For Movement" then the aging is getting wrong  and in some cases value is coming Negative.
    2. In some cases "Reason For Movement" is coming in ‘#’, but this is a mandatory field. Hence cannot be blank.
    Note:
    1. Overall stock is coming correct.
    2. Reason Movement chat. is in free char
    3. Report is based 0IC_C03.

    Hi Nadeem,
    Reason for Movement is loading from  what attribute?  check in RSRV for that attribute.
    RSRV-->All Elementary Tests ->Master Data ->Compare Size of P-, Q- with X- and Y- Tables respectively .
    If it has any error then  correct that error in RSRV. It  will solve your problem.
    Regards,
    Rajesh

  • How to Calculate the Stock aging report in BW

    Dear All,
    Please let me know the process to calculating the Stock Aging report in BW.
    And what are date field need to be consider and what are customer exits used to populated different agings in Stock like 0-30 days etc.
    Thanks
    Regards,
    Sai

    Hello,
    I would be very happy if you send me some sample code to implement this in User exits.
    I mean which ABAP statements are useful in this case. I think we need to implement the following logic for User Exit variable.
    1. At run time, retieve the SSN data from BW dabase
    2. Convert the first 5 digets into *****
    3. Make it available to report in BEX.
    Thanks
    VNM

  • Batch transaction stock aging report

    Hi Experts,
    Can you some one help me with query which give stock aging report base on Batch wise transactions (IBT1).
    Item Code,    Item description  Batch#(Qty which are >0),  Batch Qty,  Stock "IN" creation Date,
    Thanks for your help.
    Regards,
    Suresh

    Dear parneeth,
    As requested please try this Query to fulfill your requirement.
    SELECT T0.docnum,
    T2.BatchNum,T2.ItemCode,T2.Quantity,
    T2.ItemName,T0.CardName as Supplier,
    T2.SuppSerial,T2.IntrSerial,T2.ExpDate,T2.PrdDate,T2.InDate,T2.Located,
    convert(varchar(8000),T2.Notes)
    FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry=T1.DocEntry
    inner join
    OIBT T2 on T1.ItemCode = t2.ItemCode and T0.objtype=T2.basetype and T2.baseentry=T1.Docentry
    inner join
    oitm T5 on T1.Itemcode=T5.Itemcode
    WHERE
    T2.quantity>0
    group by T0.docnum,T2.BatchNum,T2.ItemCode,T2.Quantity,
    T2.ItemName,T0.CardName,
    T2.SuppSerial,T2.IntrSerial,T2.ExpDate,T2.PrdDate,T2.InDate,T2.Located,
    convert(varchar(8000),T2.Notes),T1.Linetotal,T1.Quantity
    REGARDS
    MANGESH PAGDHARE.
    Edited by: MANGESH  PAGDHARE on Jan 9, 2012 6:31 PM

  • Stock ageing report with batch Management active

    Hi Experts,
    My client wants a Stock ageing report and batch management is active
    According to my client, Inventory ageing report should show stock quantities and stock value as follows,
    1. Below one year
    2. Between one and two years
    3. Above two years
    What are the table and fields to be considered for this report.
    Thanks
    NDS

    What steps do you mean? taking an ABAP course and doing it yourself, or stepping to an ABAPer and let him know what he shall do?
    you asked for a stock report, not for a movement report.
    If I go into my warehouse and looking at all the stuff sitting there and want a report that should tell me how old this stuff is, then i am not intrested if there was a goods receipt movement.
    However I would like to know the last movement date. In this case you have to look into table S032 or into the movements MSEG (with MKPF as header table)

  • Stock ageing report in inventory management

    Hi,
    iam working in stock ageing report my requirment is i for developing stock ageing i have chars for plant and material ,and other 2 chars but i dont have cal day i have only creation on date means posting date only availble .my current layout is :
    Plant
    Plant   Material     0 u2013 30 Days  30 u2013 60 Days 60 u2013 90 Days  90 u2013 180 Days   > 180 Days     
    Expired     Blocked     Restricted
    above is mentioned is my current layout.
    but now user will be want  they want see 0-30 below month also mean july- august same as 30-60 also.
    Report to display always 2 months data at a time. Previous month closing and current month ongoing                                        
    this is my requirement please hpe help on this.
    thanks in advance.
    Deva

    As you already noticed not only the input (GR) but the output (GI) is also important.
    The date of the GR is only one thing, but after that you received the goods in your SLoc you cannot make difference between stocks received at different times.
    As your stock is not distinguished in the system as per the GR date you cannot say that which sub-stock has been consumed during GI.
    So, without batch management you cannot achieve your goal in standard system.
    Of course, physically you can realize your idea by putting labels on different batches - this would mean batch management physically and not in SAP.
    If you use warehouse management you can use a workaround: the GR date is stored in the quants and this makes possible to track the age of the stock without batch management. Please check:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/f83b5e4afa11d182b90000e829fbfe/frameset.htm
    Regards,
    Csaba

  • Urgent: regarding stock aging report

    hi,
    i want to have t-code for 'STOCK AGING REPORT' which shows that this material is present in the plant from this <b>date</b>. <b>plzzz provide me the tcode for it.</b>
    if anybody provide me solution to it will be definately rewarded.
    Message was edited by:
            ric .s
    Message was edited by:
            ric .s
    Message was edited by:
            ric .s

    Hi,
    Please try transaction code MC50
    also u can use mc.9 in that use fields like last consumed last good issued and last goods receipt
    after runing report u will get material and values t add above fields
    press f6 and add last consumed last good issued and last goods receipt
    and with this data u can analys this data
    Reward if found  helpful ...
    Cheers,
    Chandra Sekhar.

  • Stock Aging report logic

    Hi ,
    There is a report requirement from stock aging report based on the bucket scenario.
    I need to calculate the stock based on quantity(MSEG - MENGE) and moving average price/periodic unit price(MBEW - VERPR).
    Then i need to perform the same into bucket scenario like 0-09 ,91-180,180-360,>360.
    I can see the field (MENGE) in the standard datasource 2LIS_03_BF which is connecting with the infoobject 0QUANT_B.
    But in the update rule/transformation there no assignment for this.
    For which infoobject i can map to the cube and what logic i need to perform.
    There is a calculation for this in the report for the value of the stock below.
    Value = Quantity(MENGE)xmoving average price/periodic unit price(VERPR).
    Stock Logic:
    Stock is consider based on the movement types: 101,701,712.
    Can anyone give me the idea on this how to perform the logic.
    Thanks,
    satya

    Hi Vijay,
    Functional consultant has given the logic for calculating the stock is
    Stock Quantity is restricted based on the movement types 101,701,712.
    Stock Value = QuantityxMoving average price /periodic unit price
    The logic for calculating the buckets based on the Posting date(0PSTNG_DATE).
    My concern is how i can perform the same logic in BW side to calculate the value of the stock.
    Advice...
    Thanks,
    Satya
    Edited by: satya prasad on Aug 5, 2011 7:03 AM

  • Stock ageing report by profit center

    hi I am new to abap, please kindly send the code for the stock ageing report by profit center in MM module

    hi,
    for getting stock ageing report in  profit center in MM
    use the tcode :
    S_ALR_87013348
    from this u can get the necessary data.
    rewards points if useful.
    regards
    sandhya

  • Stock Ageing Report in BIW

    Hi Friends,
    We have a requirement to create stock ageing report in BIW.
    If i create the report based on the material documnet date which is coming in 0IC_C03 cube,i will get correct ageing as far as manufacturing plant is concerned.
    But we have defined the sales depots also as plants in our R/3,so if i take the material doc date from the ic_c03 cube,my ageing will be wrong for my sales depots because here it will consider the documnet(material) received into the depot date and will not consider the material manufacture(updated into system by 101 movement).
    So in my depots,i will get the wrong ageing based on the material received date and not the manuf date.
    So how do i go about this issue.
    Awaiting your inputs..
    Thanks & Regards
    Sudhakar M

    Hi
    You can look for some standard date fileds in MM03 transaction under Production for material manufacturing data and map this field in BW to fetch data and use the field in your query for ageing
    Assign points if useful
    Regards
    N Ganesh

  • Stock ageing report without Batch Management

    Hi Gurus,
    My client wants a Stock ageing report. But my concern here is can we achieve this  without batch management
    According to my client, Inventory ageing report should  show stock quantities and stock value as follows,
    1. Below one year
    2. Between one and two years
    3. Above two years
    We can accumulate the goods receipt as per Material document date and movement type according to the above age requirement.
    But, can we track goods issues from the above age groups without Batch Management.
    Experts Pls reply and If possible, pls explain how we can achieve this.
    Thanks
    NDS

    As you already noticed not only the input (GR) but the output (GI) is also important.
    The date of the GR is only one thing, but after that you received the goods in your SLoc you cannot make difference between stocks received at different times.
    As your stock is not distinguished in the system as per the GR date you cannot say that which sub-stock has been consumed during GI.
    So, without batch management you cannot achieve your goal in standard system.
    Of course, physically you can realize your idea by putting labels on different batches - this would mean batch management physically and not in SAP.
    If you use warehouse management you can use a workaround: the GR date is stored in the quants and this makes possible to track the age of the stock without batch management. Please check:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/f83b5e4afa11d182b90000e829fbfe/frameset.htm
    Regards,
    Csaba

  • Stock aging Report

    Dear Experts ,
    I want a stock aging report for a material plant & vendor input combination which would give me the following details as output :
    First GR date & qty
    Last GR date & qty
    Stock qty & value on end date  date
    Is there any std report for the same in SAP ?
    Regards
    Lakeer Bhatt

    Hi dear,
    Refer below link
    [http://wiki.sdn.sap.com/wiki/display/ERPLO/SAP%20Standard%20Reports?bc=true]
    You can refer below T. codes for inventory aging but in non of the report vendor will come into picture.
    MC.9 - INVCO: Material Analysis Selection, Stock
    MC.A - INVCO: Material Analysis Selection, Rec/Iss
    MC.B - INVCO: Material Analysis Selection, Turnover
    MC.C - INVCO: Material Analysis Selection, Coverage
    MCBV - INVCO: Parameter Analysis Selection
    MCBZ - INVCO: Stock/Requirement Analysis Selection
    MCB) - INVCO: Long-Term Stock Selection
    MC40 - INVCO: ABC Analysis of Usage Values
    MC41 - INVCO: ABC Analysis of Requirement Values
    MC50 - INVCO: Analysis of Dead Stock
    MC49 - INVCO: Mean Stock Values
    MC44 - INVCO:Analysis of Inventory Turnover
    MC.1 - INVCO: Plant Analysis Selection: Stock
    MC.5 - INVCO: Storage Location Analysis Selection, Stock
    MC.T - INVCO: Material Type Analysis Selection, Stock
    MC46- slow moving items
    MB5B
    Edited by: Deepak Kulkarni on Mar 3, 2011 12:04 PM

Maybe you are looking for

  • Install of Adobe Creative Suite 5 Design Premium upgrade on Mountain Lion

    Hi, Just wondering is anyone had issues installing Adoeb Creative Suite 5 Design Premium upgrade on Mountain Lion. I can't seem to completed the installation of the components. The "INSTALL" button just doesn't work. I have tried install from desktop

  • Answers for these interview Q's

    Hi BW experts, I want to know the answers for these interview Q's I faced. 1). What is the use of Nav. Attribute other than the drill down functionality in the reports. 2). What is the use of PSA?(I answered, we can update the errored records).  But,

  • Using XDK to Parse Schema

    I'm having problems parsing an XSD file with xmlparserv2, and I suspect it's something simple I'm missing ... Java Code: DOMParser dp = new DOMParser(); dp.setValidationMode(XMLParser.SCHEMA_VALIDATION); dp.setPreserveWhitespace (true); dp.setErrorSt

  • Why won't Bridge CS6 launch?

    I've just installed Photoshop CS6 (64bit).  I cannot launch Adobe Bridge - I get the message "Waiting for Bridge CS6....." and it won't progress beyond this point.  Has anyone got any idea what I can do?  I've rebooted the PC, but still the same.

  • RemoteApp Requires IE 11 (Windows 8.1) to be "Run As Administrator"

    User environment (Not Working): Windows 8.1 Enterprise Internet Explorer 11.0.9600.17498 (Update Version: 11.0.15 KB3008923) User Environment (Working): Windows 7 Internet Explorer 10.0.9200.17148 (Update Version: 10.0.22 KB3003057) Server environmen