Opening & Closing Stock - Query Correction

Dear Experts,
                         Please find the below query, where I need IN quantity & values , OUT quantity& values should  pick only from  Standard Production Order , whereas  it should not pick from special Production Order. Rest all in the same is sufficient for me.
Declare @FromDate Datetime
Declare @ToDate Datetime
Declare @ItmsGrpNam varchar(100)
select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >= '[%0]'
select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
select @ItmsGrpNam = max(s2.ItmsGrpNam) from dbo.OITB S2 Where S2.ItmsGrpNam ='[%2]'
Select  a.Itemcode, max(a.Dscription) as ItemName,
(Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM,
sum(a.OpeningBalance) as OpeningBalance,
sum(a.OpeningValue) as OpeningValue,
sum(a.INq) as 'IN',
(select SUM(ISNULL(T100.TRANSVALUE,0)) from oinm T100 WHERE T100.ITEMCODE = A.ITEMCODE
AND T100.DOCDATE >= @FROMDATE
AND T100.DOCDATE <= @TODATE AND T100.INQTY <> 0) AS [IN Stock Value],
sum(a.OUT) as OUT,
(select SUM(ISNULL(T100.TRANSVALUE,0)) from oinm T100 WHERE T100.ITEMCODE = A.ITEMCODE
AND T100.DOCDATE >= @FROMDATE
AND T100.DOCDATE <= @TODATE AND T100.OUTQTY <> 0)*-1 AS [OUT Stock Value],
((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing ,
(select SUM(T100.TRANSVALUE) from oinm T100 WHERE
T100.ITEMCODE = A.ITEMCODE AND T100.DOCDATE < @TODATE) AS [Closing Value Transaction],
(((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT))*
ISNULL((SELECT CASE WHEN
X.PRICE = 0
THEN
(SELECT DISTINCT MAX(ISNULL(P.PRICE,0)) AS PRICE FROM ITM1 P WHERE PRICELIST = 1 )
ELSE
X.PRICE
END
FROM (SELECT
DISTINCT MAX(ISNULL(B.PRICE,0)) AS PRICE
FROM OITM T
LEFT JOIN PCH1 B ON T.ITEMCODE = B.ITEMCODE
INNER JOIN OPCH C ON B.DOCENTRY = C.DOCENTRY
WHERE B.DOCENTRY =  (SELECT DISTINCT (MAX(D.DOCENTRY)) FROM OPCH D WHERE C.DOCENTRY = D.DOCENTRY
AND C.DOCDATE <= @ToDate )
AND A.ITEMCODE = T.ITEMCODE) X ),0))
--(Select i.LstEvlPric from OITM i where i.ItemCode=a.Itemcode))
as 'Closing Value',
(Select i.LastPurDat from OITM i where i.ItemCode=a.Itemcode) as 'Last Purchase Date',
--(Select i.LstEvlDate from OITM i where i.ItemCode=a.Itemcode) as 'Last Issue Date',
--(Select i.ItmsGrpCod from OITM i where i.ItemCode=a.Itemcode) as 'Group code',
(Select b.ItmsGrpNam from OITB b where  b.ItmsGrpCod = I1.ItmsGrpCod) as 'Group Name'
from( Select  N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
as OpeningBalance,
(sum(N1.Transvalue))
as OpeningValue,
0 as INq, 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate <@FromDate and b.ItmsGrpNam = @ItmsGrpNam
Group By N1.ItemCode,N1.Dscription
Union All
select N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue,
sum(N1.inqty) , 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate >= @FromDate and N1.DocDate <= @ToDate
and N1.Inqty >0  and b.ItmsGrpNam = @ItmsGrpNam
Group By N1.ItemCode,N1.Dscription
Union All
select  N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue, 0 , sum(N1.outqty) as OUT
From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate >= @FromDate and N1.Transtype != 67
and N1.DocDate <=@ToDate and N1.OutQty > 0 and  b.ItmsGrpNam = @ItmsGrpNam
Group By N1.ItemCode,N1.Dscription) a, dbo.OITM I1 ,OITB b1
where a.ItemCode=I1.ItemCode
and I1.ItmsGrpCod = b1.ItmsGrpCod
Group By a.Itemcode ,I1.ItmsGrpCod , b1.ItmsGrpNam 
Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0
Order By a.Itemcode
Thanks in Advance,
Bhoopathi.K

Hi,
Try this:
Declare @FromDate Datetime
Declare @ToDate Datetime
Declare @ItmsGrpNam varchar(100)
select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >= '[%0]'
select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
select @ItmsGrpNam = max(s2.ItmsGrpNam) from dbo.OITB S2 Where S2.ItmsGrpNam ='[%2]'
Select  a.Itemcode, max(a.Dscription) as ItemName,
(Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM,
sum(a.OpeningBalance) as OpeningBalance,
sum(a.OpeningValue) as OpeningValue,
sum(a.INq) as 'IN',
(select SUM(ISNULL(T100.TRANSVALUE,0)) from oinm T100 WHERE T100.ITEMCODE = A.ITEMCODE
AND T100.DOCDATE >= @FROMDATE
AND T100.DOCDATE <= @TODATE AND T100.INQTY <> 0) AS [IN Stock Value],
sum(a.OUT) as OUT,
(select SUM(ISNULL(T100.TRANSVALUE,0)) from oinm T100 WHERE T100.ITEMCODE = A.ITEMCODE
AND T100.DOCDATE >= @FROMDATE
AND T100.DOCDATE <= @TODATE AND T100.OUTQTY <> 0)*-1 AS [OUT Stock Value],
((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing ,
(select SUM(T100.TRANSVALUE) from oinm T100 WHERE
T100.ITEMCODE = A.ITEMCODE AND T100.DOCDATE < @TODATE) AS [Closing Value Transaction],
(((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT))*
ISNULL((SELECT CASE WHEN
X.PRICE = 0
THEN
(SELECT DISTINCT MAX(ISNULL(P.PRICE,0)) AS PRICE FROM ITM1 P WHERE PRICELIST = 1 )
ELSE
X.PRICE
END
FROM (SELECT
DISTINCT MAX(ISNULL(B.PRICE,0)) AS PRICE
FROM OITM T
LEFT JOIN PCH1 B ON T.ITEMCODE = B.ITEMCODE
INNER JOIN OPCH C ON B.DOCENTRY = C.DOCENTRY
WHERE B.DOCENTRY =  (SELECT DISTINCT (MAX(D.DOCENTRY)) FROM OPCH D WHERE C.DOCENTRY = D.DOCENTRY
AND C.DOCDATE <= @ToDate )
AND A.ITEMCODE = T.ITEMCODE) X ),0))
--(Select i.LstEvlPric from OITM i where i.ItemCode=a.Itemcode))
as 'Closing Value',
(Select i.LastPurDat from OITM i where i.ItemCode=a.Itemcode) as 'Last Purchase Date',
--(Select i.LstEvlDate from OITM i where i.ItemCode=a.Itemcode) as 'Last Issue Date',
--(Select i.ItmsGrpCod from OITM i where i.ItemCode=a.Itemcode) as 'Group code',
(Select b.ItmsGrpNam from OITB b where  b.ItmsGrpCod = I1.ItmsGrpCod) as 'Group Name'
from( Select  N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
as OpeningBalance,
(sum(N1.Transvalue))
as OpeningValue,
0 as INq, 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate <@FromDate and b.ItmsGrpNam = @ItmsGrpNam
Group By N1.ItemCode,N1.Dscription
Union All
select N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue,
sum(N1.inqty) , 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate >= @FromDate and N1.DocDate <= @ToDate
and N1.Inqty >0  and b.ItmsGrpNam = @ItmsGrpNam
Group By N1.ItemCode,N1.Dscription
Union All
select  N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue, 0 , sum(N1.outqty) as OUT
From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod left join OWOR t0 on t0.docentry = N1.[AppObjAbs]
Where N1.DocDate >= @FromDate and N1.Transtype != 67
and N1.DocDate <=@ToDate and N1.OutQty > 0 and  b.ItmsGrpNam = @ItmsGrpNam and  T0.[Type] = 's'
Group By N1.ItemCode,N1.Dscription) a, dbo.OITM I1 ,OITB b1
where a.ItemCode=I1.ItemCode
and I1.ItmsGrpCod = b1.ItmsGrpCod
Group By a.Itemcode ,I1.ItmsGrpCod , b1.ItmsGrpNam 
Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0
Order By a.Itemcode
Thanks & Regards,
Nagarajan

Similar Messages

  • Opening +Receipts-isseue =Closing Stock Query

    Dear Experts,
    I need a query with condition from to date for stock movement.
    Following Column I required in Query
    Item code, Item description, Opening +Receipts-issue =Closing Stock Query
    Thanks in Advance.
    Regards
    MANGESH PAGDAHRE.
    Edited by: MANGESH  PAGDHARE on Dec 2, 2011 11:04 AM

    Hi
    Here is the query
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Whse nvarchar(10)
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]'
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
    select @Whse = Max(s2.Warehouse) from dbo.OINM S2 Where S2.Warehouse = '[%2]'
    Select @Whse as 'Warehouse', a.Itemcode, max(a.Dscription) as ItemName,
    sum(a.OpeningBalance) as OpeningBalance, sum(a.INq) as 'IN', sum(a.OUT) as OUT,
    ((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing ,
    (Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM
    from( Select N1.Warehouse, N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
    as OpeningBalance, 0 as INq, 0 as OUT From dbo.OINM N1
    Where N1.DocDate < @FromDate and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,
    N1.Dscription Union All select N1.Warehouse, N1.Itemcode, N1.Dscription, 0 as OpeningBalance,
    sum(N1.inqty) , 0 as OUT From dbo.OINM N1 Where N1.DocDate >= @FromDate and N1.DocDate <= @ToDate
    and N1.Inqty >0 and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,N1.Dscription
    Union All select N1.Warehouse, N1.Itemcode, N1.Dscription, 0 as OpeningBalance, 0 , sum(N1.outqty) as OUT
    From dbo.OINM N1 Where N1.DocDate >= @FromDate and N1.DocDate <=@ToDate and N1.OutQty > 0
    and N1.Warehouse = @Whse Group By N1.Warehouse,N1.ItemCode,N1.Dscription) a, dbo.OITM I1
    where a.ItemCode=I1.ItemCode
    Group By a.Itemcode Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0 Order By a.Itemcode
    Regards,
    Sudhir B.

  • Storage location wise Opening/Closing Stock on posting date (mb5b)

    Hi,
    Report mb5b gives opening stock and closing stock as on date. In the selection screen, if we do not enter specific storage location then the opening/closing stock is displayed as sum of all storage location stocks for a given material.
    Where as if we enter storage location, it gives storage location specific output. (with Storage loc/batch stock radio button)
    My requirement is - without entering storage location in the initial screen, the system should display storage location specific opening/closing stock.
    To get this, presently I need to execute mb5b transaction individually for every storage location.
    Warm regards,
    MS

    Hi Madhavi
    This report you can have in T code MC.6 and another t code for opening and closing stock in t code MC.9
    Regards
    Vivek
    -- Reward if helpful
    Edited by: Supergene on Feb 28, 2008 3:17 PM

  • Opening & Closing Stock in transit

    Hi All,
    I Developed an abap report for Yield Statement with opening & closing Stock Quantities.
    How to Find opening & Closing For transit Stock for 641 movement.I mean how to display the current transit stocks date wise at plant level without SLOC.
    I Knew that current transit stock would be in Marc Table & previous closings in March Tables.
    I'm looking for the date logic with respect to displaying opening & closing dates of transit stock.Be it Date Wise Or Month Wise.
    Any help would be greatly appreciated.
    Thanks & Regards,
    Ravi S

    Hi Ravi,
    Please find the Link below hope they are very useful to you
    [Stock|Re: closing stock of a particular date]
    [Stock|Tables/FM for opening/closing stock for material on given posting date]
    Thanks
    kalyan

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

  • Opening & closing stock like in tally in sql

     i have multiple table . i want to calculate opening and closing stock like in tally in sql with fifo method.
    i have make query.
    select   dd.Date,dd.VoucherNumber,dd.Name,dd.OpeningBalance OpeningBal,
     dd.OpeningQty,dd.OpeningRate,
    InwardQty=sum(case when dd.Amount >0 then dd.Quantity else 0  end), 
    InwardRate=sum(case when dd.Amount >0 then dd.Rate else 0  end),
    InwardValue= sum(case when dd.Amount >0 then dd.Amount else 0  end),
    OutwardQty=sum(case when dd.Amount <0 then dd.Quantity else 0  end ),
    OutwardRate=sum(abs(isnull((case when dd.Amount <0 then dd.Amount else 0  end)/ nullif((case when dd.Amount <0 then dd.Quantity else 0 end),0),0))),
    OutwardValue=  Sum(abs(case when dd.Amount <0 then dd.Amount else 0  end)),
    ClosingQty=dd.OpeningQty+ sum(case when dd.Amount >0 then dd.Quantity else 0  end)-sum(case when dd.Amount <0 then dd.Quantity else 0  end ) ,
    closingRate=dbo.fnGetClosingRate(dd.OpeningBalance,sum(case when dd.Amount >0 then dd.Amount else 0  end),
     Sum(abs(case when dd.Amount <0 then dd.Amount else 0  end)),dd.OpeningQty+ sum(case when dd.Amount >0 then dd.Quantity else 0  end)-
      sum(case when dd.Amount <0 then dd.Quantity else 0  end )),
      ClosingAmout=(dd.OpeningQty+ sum(case when dd.Amount >0 then dd.Quantity else 0  end)-
      sum(case when dd.Amount <0 then dd.Quantity else 0  end ))*(dbo.fnGetClosingRate(dd.OpeningBalance,sum(case when dd.Amount >0 then dd.Amount else 0  end),
     Sum(abs(case when dd.Amount <0 then dd.Amount else 0  end)),dd.OpeningQty+ sum(case when dd.Amount >0 then dd.Quantity else 0  end)-
      sum(case when dd.Amount <0 then dd.Quantity else 0  end )))
       from 
       SELECT  [Transaction].Date, [Transaction].VoucherNumber,
       Items.Name,OpeningBalance,ItemOpening.Quantity as OpeningQty,ItemOpening.Rate as OpeningRate,
      SalesItem.FirstQty as Quantity, SalesItem.Rate ,
      SalesItem.Amount 
    FROM  ItemOpening INNER JOIN
                   Items ON ItemOpening.Items = Items.Oid INNER JOIN
                   SalesItem ON Items.Oid = SalesItem.Item INNER JOIN
                   Sales ON SalesItem.Source = Sales.Oid INNER JOIN
             [Transaction] ON Sales.Oid = [Transaction].Oid 
            --where [Transaction].Date>='2012-05-19' and [Transaction].Date<='2012-05-31'
            --and Items.Name='Bidi: 96/19x20x80 HL'
            -- group by Items.Name,[Transaction].Date,SalesItem.Rate,
            -- SalesItem.Amount
                union all
       select  [Transaction].Date,[Transaction].VoucherNumber, Items.Name,
       OpeningBalance,ItemOpening.Quantity as OpeningQty,ItemOpening.Rate as OpeningRate,
       PurchaseItem.FirstQty   ,
       PurchaseItem.Rate,
    PurchaseItem.Amount 
    FROM  PurchaseItem INNER JOIN
    Purchase ON PurchaseItem.Source = Purchase.Oid INNER JOIN
    Items on Items.Oid= PurchaseItem.Item inner join 
    ItemOpening on ItemOpening.Items= Items.Oid inner join
    [Transaction] ON Purchase.Oid = [Transaction].Oid
    --where [Transaction].Date>='2012-05-18' and [Transaction].Date<='2012-05-31'
    --and Items.Name='Bidi: 96/19x20x80 HL'
    ) as dd  where   dd.Date>='2012-04-01' and dd.Date<='2012-04-05'
    and dd.Name='Bidi: 96/19x20x80 HL'
     group by dd.Date,dd.VoucherNumber,dd.Name,dd.OpeningBalance,dd.OpeningQty,dd.OpeningRate,dd.Rate
      order by dd.Date
    but it is not give correct output. its giving result .
    Date
    Name
    OpeningBal
    OpeningQty
    OpeningRate
    InwardQty
    InwardRate
    InwardValue
    OutwardQty
    OutwardRate
    OutwardValue
    ClosingQty
    closingRate
    ClosingAmout
    4/1/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    10
    3584.8
    35848
    12
    2255.1
    27061.2
    4/5/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    20
    3584.8
    71696
    2
    -4393.39
    -8786.78
    4/5/2012
    A
    62909.22
    22
    2859.51
    20
    3360
    67200
    0
    0
    0
    42
    3097.84
    130109.28
    expected format as
    Date
    Name
    OpeningBal
    OpeningQty
    OpeningRate
    InwardQty
    InwardRate
    InwardValue
    OutwardQty
    OutwardRate
    OutwardValue
    ClosingQty
    closingRate
    ClosingAmout
    4/1/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    10
    3584.8
    35848
    12
    2255.1
    27061.2
    4/5/2012
    A
    27061.2
    12
    2255.1
    0
    0
    0
    20
    3584.8
    71696
    -8
    0
    -8786.78
    4/5/2012
    A
    -8786.78
    -8
    -4393.39
    20
    3360
    67200
    0
    0
    0
    12
    3097.84
    130109.28
    please give solution

    Suppose my  view like View_itm
    Date
    Item
    openingItem
    OpnRate
    OpnAmt
    ReceiveItm
    Issue
    ClosingQty
    closingRate
    ClosnigAmt
    1/4/2012 
    A
    10
    5
    15
    5
    2
    13
    23.1
    299
    1/4/2012 
    B
    20
    2
    40
    10
    15
    15
    43
    643
    i have make above query for access data  but it not give expected result 
    Date
    Name
    OpeningBal
    OpeningQty
    OpeningRate
    InwardQty
    InwardRate
    InwardValue
    OutwardQty
    OutwardRate
    OutwardValue
    ClosingQty
    closingRate
    ClosingAmout
    4/1/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    10
    3584.8
    35848
    12
    2255.1
    27061.2
    4/5/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    20
    3584.8
    71696
    2
    -4393.39
    -8786.78
    4/5/2012
    A
    62909.22
    22
    2859.51
    20
    3360
    67200
    0
    0
    0
    42
    3097.84
    130109.28
    expected result need like 
    Date
    Name
    OpeningBal
    OpeningQty
    OpeningRate
    InwardQty
    InwardRate
    InwardValue
    OutwardQty
    OutwardRate
    OutwardValue
    ClosingQty
    closingRate
    ClosingAmout
    4/1/2012
    A
    62909.22
    22
    2859.51
    0
    0
    0
    10
    3584.8
    35848
    12
    2255.1
    27061.2
    4/5/2012
    A
    27061.2
    12
    2255.1
    0
    0
    0
    20
    3584.8
    71696
    -8
    0
    -8786.78
    4/5/2012
    A
    -8786.78
    -8
    -4393.39
    20
    3360
    67200
    0
    0
    0
    12
    3097.84
    130109.28
    please give solution as per possible 

  • Opening Closing Stock in transit Report

    Hi,
    I have to get the ABAP development of Stock Report. Report would have following fields
    Opening Stock
    Opening Stock in Transit Quantity
    GR Quantity
    Purchase Value
    Sold Quantity
    Rejection Quantity
    Closing Quantity
    Closing Stock in Transit Quantity
    Consumption Quantity
    In Closing quantity , It should be without stock in transit quantity.
    Could you please help me to understand ,Exact Opening Stock ,Closing sock, In Transit Stock etc? How would these be calculated? from which tables all these data would come from. Thanks in advance.
    Regarda,
    Santosh

    SantoshArya wrote:
    Hi,
    >
    > I have to get the ABAP development of Stock Report. Report would have following fields
    >
    > Opening Stock
    > Opening Stock in Transit Quantity
    > GR Quantity
    > Purchase Value
    > Sold Quantity
    > Rejection Quantity
    > Closing Quantity
    > Closing Stock in Transit Quantity
    > Consumption Quantity
    >
    > In Closing quantity , It should be without stock in transit quantity.
    >
    > Could you please help me to understand ,Exact Opening Stock ,Closing sock, In Transit Stock etc? How would these be calculated? from which tables all these data would come from. Thanks in advance.
    > Regarda,
    > Santosh
    Hi,
    You can also check these standard reports before you proceed to develop a report..
    MB52 - List of Warehouse Stocks on Hand
    MB53 - Display Plant Stock Availability
    MB5B - Stocks for Posting Date
    MB5C - Pick-Up List
    MB5L - List of Stock Values: Balances
    MB5W - List of Stock Values
    MB5T - Stock in transit CC
    MC.9 - INVCO: Material Analysis Selection, Stock
    MC.A - INVCO: Material Analysis Selection, Rec/Iss
    MC.B - INVCO: Material Analysis Selection, Turnover
    You can also consider building a query report which wil also serve your purpose quickly...
    Regards
    Shiva

  • Closing Stock Query

    Hi Members,
    We Want a report for closing stock according to the following parameters,
    1-Date from
    2-Date to
    3-Warehouse
    4-Document Series
    Query Report should contain with,
    Item Code - Item Description - Inventory UOM - Quantity - Item cost(FIFO Value) - Value
    (Inventory Audit Report can not use with document Series)
    Thank You
    Saman

    Hi Rahul,
    thank you for reply. You are correct. but in our company we use only 10 document series. under this 10 series all type of
    documents are available . so when we select a one series it is containing all of SAP B1 document type.
    Example-
    Series A- (Delivery , GRN, Return, A/P invoice,A/R Invoice, Payment .....ect) 
    Series B- (Delivery , GRN, Return, A/P invoice,A/R Invoice, Payment .....ect)
    Series C- (Delivery , GRN, Return, A/P invoice,A/R Invoice, Paymet .....ect)
    So Results of this Query  will be a meaning full One.
    Can You Suggest a Query for my requirement. I Hope Your Idea.
    Saman

  • Storage location wise opening, closing stock...date wise...report

    Hi all Experts,
    I am at client site and hav to provide a report containing opening, and closing stock (and issue qty if possible) storage location wise and date option wise.pls help
    regards
    vikas chhabra

    Hi,
    Use MB51 for date wise report
    OR
    Use MCL1, MCL5, MCL9, MCLD (If Warehouse Management you are using)
    OR
    You have to develop an own ABAP report.
    Regards,
    Biju K

  • How to get Opening /Closing stock value of Non Valuated stock materails

    Hello,
    We would like to know since 95% of our procurement will be for Projects and since the stock is u201CNon-Valuatedu201D stock, is there any method by which we will be in a position to get the  details of Opening Stock, Purchases & Closing Stock?
    Regards
    Sapman man

    hi
    try mb52
    enter maerial type for nonvaluated stock
    then
    execute
    you will  get output
    regards
    vijay

  • Opening & Closing Stock in P&L Statement

    Dear All,
    My client is using Tally software preior to SAP B1 Implementation. In Tally the P/L satatment shows  Opening Stock , purchases and  Closing Stock ledgers.We are not using Purchase Accounts posting system. How to map the existing SAP Ledgers  according to Tally. We are using SAP B1 2007 B.
    Please help me to map the G/L accoring to the above requirements.
    Thanks
    Srini

    Dear Srini,
    Yes of-course Tally shows OB,and Closing balance at a particular time, SAP B1 Shows them too, but in a different manner.
    1. Suppose , you have given OB to SAP on 01/04/10.(which is actually the closing balance of Tally as on 31/03/10).
        Under trial balance report OB Column is there.
         If you are trying to populate Tally's OB of 01/04/09, You Can't.
    2. Getting the OB at a particular time in SAP, depends how you are maintaining your Posting Periods.
    For Closing balance in SAP, The last column -'Balance' is actually the Closing balance as on the date for you are running Trial Balance Report.
    Hope this will help you.
    Best Regards
    Ashutosh T

  • Opening & closing stock

    Hi Expert,
        I am developing one zreport . i want to know how to calculate
    opening and closing stock using mb5b standard report.
    Thanks
    Dinesh

    Hi,
    I would be really thankful if you could send me a couple of z_reports with the input parameters and output parameters, as we too are going for implementation project. Kindly send it to [email protected]
    Your help would really be appreciated.
    Regards.

  • Crystal Query for Opening / Closing Stock

    Hi Experts,
    i need a query in crystal for Opening and Closing total Stock per date..
    i found this querys and need to join them, but o dont now how...
    thanks for any tips..
    Query 1
    =======================
    SELECT  distinct
    T0.[TransType], T0.[DocDate],  T0.[InQty], T0.[OutQty], T0.[Dscription], T0.[CalcPrice], T0.[ItemCode] FROM [dbo].[OINM]  T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[DocDate] >= {?DateInicial} and  T0.[DocDate] <= {?DateFinal} and T1.[Canceled] = 'N'
    Query 2
    =========================
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >={?Data1}
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <={?Data2}
    Select a.Itemcode, max(a.Dscription) as ItemName,
    sum(a.OpeningBalance) as OpeningBalance, sum(a.INq) as 'IN', sum(a.OUT) as OUT,
    ((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing ,(Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM
    from( Select N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
    as OpeningBalance, 0 as INq, 0 as OUT
    From dbo.OINM N1

    try this
       Declare @ItmsGrpNam varchar(100)
    Declare @Whse nvarchar(10)
    Declare @Fromdate Datetime
    Declare @Todate DateTime
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >=[%0]
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <=[%1]
    select @Whse = Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse = [%2]
    Select  a.Itemcode, max(a.Dscription) as ItemName,
    (Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM,
    sum(a.OpeningBalance) as OpeningBalance,
    ((sum(a.OpeningBalance) + sum(a.INq)) - Sum(a.OUT)) as Closing
    from( Select  N1.Itemcode, N1.Dscription, (sum(N1.inqty)-sum(n1.outqty))
    as OpeningBalance, 0 as INq, 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
    inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
    Where N1.DocDate < @FromDate and N1.Warehouse = @Whse and  b.ItmsGrpNam = @ItmsGrpNam
    Group By N1.ItemCode,
    N1.Dscription Union All select N1.Itemcode, N1.Dscription, 0 as OpeningBalance,
    sum(N1.inqty) , 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
    inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
    Where N1.DocDate >= @FromDate and N1.DocDate <= @ToDate
    and N1.Inqty >0  and N1.Warehouse = @Whse and  b.ItmsGrpNam = @ItmsGrpNam Group By N1.ItemCode,N1.Dscription
    Union All select  N1.Itemcode, N1.Dscription, 0 as OpeningBalance, 0 , sum(N1.outqty) as OUT
    From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
    inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
    Where N1.DocDate >= @FromDate
    and N1.DocDate <=@ToDate and N1.OutQty > 0 and N1.Warehouse = @Whse and  b.ItmsGrpNam = @ItmsGrpNam
    Group By N1.ItemCode,N1.Dscription) a, dbo.OITM I1 ,OITB b1
    where a.ItemCode=I1.ItemCode
    and I1.ItmsGrpCod = b1.ItmsGrpCod
    Group By a.Itemcode ,I1.ItmsGrpCod , b1.ItmsGrpNam 
    Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0
    Order By a.Itemcode 

  • Opening closing stock receipts and issues analysis

    Hi,
    Is it possible to match the values in the MC.A (Total Receipts and Issues Values) to Gl Accounts,
    If it is possible How?

    Hi,
    from within the MC.A there is a link directly to the accounting documents that are involved.
    Go to the menu option Extras > accounting doc for material when you have the data for a material displayed.
    By careful and make sure that you have selected the correct flag on the values window of the initial selection screen.
    Steve B

  • Calculating Opening / Closing Stock of a day

    Hi,
    I will be thankfull if any one can give us solution for calculating Inventory of a item  on a particulare given day. If some one has came across same situation please revert ASAP.
      Regards
    Anubhav

    Hi
    Have you looked at the table oinm? This has all stock transactions whether they are coming into the system or out of the system.
    Hope this helps

Maybe you are looking for

  • HTML Help is not working in SAP

    Hi, Here we are facing some problem when we are accessing SAP Help through SAP. Though windown XP i am accessing the SAP Application Help. Here in my PC i am having 4 windows XP hotfixes, through it the help is accessing.But in another PC which autom

  • How do i install this site

    0728625951

  • Sh cef drop

    Encap_fail is increasing , pinging the tunnel public ip of hub from spoke results in packet loss on one of spoke: interface Tunnel1 bandwidth 1000 ip address y.y.y.y4 255.255.255.0 no ip redirects ip mtu 1416 ip nhrp authentication *********** ip nhr

  • Recover standby database error

    Hi here is the error message i got when i run this command 09:30:35 SYS@MOZAI> alter database recover standby database until cancel; alter database recover standby database until cancel ERROR at line 1: ORA-00279: change 126425376421 generated at 02/

  • Quick question using BatchAction

    I'm an FDM newbie, so some of the question I'm asking may seem to be trivial... Is it possible to trigger an event from BatchAction? I wrote some code in BatchAction and want to trigger specific events (basically I want to mimic the steps I take manu