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 

Similar Messages

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

  • 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

  • Authorization for opening & Closing posting periods - OB52

    Hi,
    Is there any way to set authorization for opening & closing of posting periods in OB52?
    My scenario:
    I have 2 company codes - A & B assigned to 2 different posting period variant - say PPA & PPB.
    The user belonging to CoCd A should not be able to open/close posting period of CoCd B and vice versa.
    Is this possible through any authorization settings?
    Request your help on this.
    Regards,
    Sridevi

    Hi Sridevi
    Please go through the following:
    You can assign authorization groups for permitted posting periods. This means that, for example, some posting periods can only be opened for particular users within monthly or annual closing. You can only assign the authorization group at document header level and it only affects period 1. The authorization object is called F_BKPF_BUP (Accounting document: Authorizations for posting periods). Read the corresponding chapter on "User maintenance" in the "Assigning authorizations" topic.
    "User maintenance"
    Due to the modular authorization concept of the system, you can define authorization profiles which are tailored to the workplace of your employees. You can, for example, assign authorization to a workplace in the Accounts Receivable, Accounts Payable or General Ledger Accounting areas.
    By assigning authorizations you define which business-related objects your employees are allowed to process and which editing functions are allowed.
    In the following activities for authorization management, you must carry out the following for employees who are to work with the system:
    Assign authorizations
    The authorizations are assigned by specifying permitted values for the pre-defined objects.
    Define profiles
    In the SAP system, authorizations are grouped together in workplace profiles. Therefore one or more profiles must be allocated to the individual employee in the master record.
    I hope this helps.
    Regards
    Kavitha

  • Query for Opening And  Closing Stock

    Hi Experts...
    I need a report for Opening and Closing stocks and Goods Receipt and Goods Issue for Raw Materials and Finished Goods and Consumbles ..instead of going for different reports for each we need a combined report which can display for all Raw Materials, Finished Goods and Consumbles and we need it for a specific date range Material type(Raw MAterials,Finished Goods, Consumbales)
    and below is the format i needed.
                                                                           RAW MATERIALS /FINISHED GOODS/CONSUMBALES
                            Opening Stock                      Closing Stock         Goods Receipt                  Goods Issue
                             Qty   Value                             Qty   Value                     Qty   Value                      Qty   Value
    Item Name
    Regards,
    Vamsi.

    Hi Guys.
    I need an Inventory stock report with Item name, Opening Stock,Goods issue Quantity,Goods Received ,Item Price,Location ,(Closing Stock)Total Value.
    We need the input by Date Range and Item Group and Location(if Possible) Below is the Code i used to run the report.
    Pls Update the Query...
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @Group nvarchar(10)
    Declare @Whse nvarchar(10)
    Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]')
    Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
    Set @Group = (Select Max(s2.ItmsGrpCod) from dbo.OITB S2 Where S2.ItmsGrpNam = '[%2]')
    Set @Whse = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse = '[%3]')
    Select @Whse as 'Warehouse', a.Itemcode, max(a.Dscription), sum(a.[Opening Balance]) as [Opening Balance], sum(a.[IN]) as [IN], sum(a.OUT) as OUT,max(a.Price) as 'Price', ((sum(a.[Opening Balance]) + sum(a.[IN])) - Sum(a.OUT)) as Closing from dbo.OITM I1
    Left JOIN (Select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.Price, (sum(N1.inqty)-sum(n1.outqty)) as [Opening Balance], 0 as [IN], 0 as OUT
    From dbo.OINM N1
    Where N1.DocDate < @FromDate and N1.Warehouse = @Whse
    Group By N1.Warehouse,N1.ItemCode,N1.Dscription,N1.Price
    Union All
    select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.price, 0 as [Opening Balance], sum(N1.inqty) as [IN], 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,N1.price
    Union All
    select N1.Warehouse, N1.Itemcode, N1.Dscription,N1.price, 0 as [Opening Balance], 0 as [IN], 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,N1.price) a ON a.ItemCode=I1.ItemCode
    where  I1.ItmsGrpCod = @Group
    Group By a.Itemcode
    Order By a.Itemcode
    Regards,
    Vamsi.

  • Query for Opening Stock + Purchase Qty + Sales Qty

    Hi ,
    Can anyboday help me by how to develop a query for the following requirement. If any custom query is available please provide me .We are working on SBO 2007B PL 8. The required report structure is 
        ItemNo ***OpeningStock**** Purchase ********* Sales****
    (Batchwise)** Qty*** Value ****Qty** Value ***Qty***Value
    Thanks & Regards
    Srini

    Hi Srini,
    I found this on the forum, see if it helps you;
    select b.Itemcode,b.Item_Description,b.UOM, b.rate as Rate,b.Opening_Stock,b.Receipt,b.Issue, b.Material_Revalue,b.Closing_Stock,b.Closing_Value from (select *,(case closing_stock when 0 then 0 else(Closing_Value/Closing_Stock)end) as Rate from( SELECT T0.Itemcode as 'Itemcode' ,min(T0.Dscription) as 'Item_Description', max(T1.InvntryUom) as UOM, (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<'[%0]' and O1.transtype in (58,59,20,16,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<'[%0]' and O1.transtype in (58,21,19,60,15,67,-2,13)),0)+ (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0)))as Opening_Stock, (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (20,18)),0) + isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (67)),0) + isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (58,59,16,14)),0)) as Receipt, (isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>0 and O1.transtype in (13,15)),0) + isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>0 and O1.transtype in (67)),0)+ isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>0 and O1.transtype in (58,60,21,19)),0)) as Issue, isnull((select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<='[%1]' and O1.transtype in (162)),0) as Material_Revalue, (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<='[%1]' and O1.transtype in (58,59,20,16,14,19,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<='[%1]' and O1.transtype in (58,21,19,60,15,67,-2,13)),0))as Closing_Stock, isnull((select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.docdate<='[%1]' and O1.transtype in (58,18,-2,67,59,20,16,14,15,13,21,19,60,69,162)),0) as Closing_Value FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod where ((B1.ItmsGrpNam>='[%2]' and B1.ItmsGrpNam<='[%3]') or ('[%2]'='' and '[%3]'='')) GROUP BY T1.itemcode,T0.Itemcode )a Where (a.Opening_Stock + a.Receipt + a.Issue + a.Material_Revalue + a.Closing_Stock + a.Closing_Value) <> 0 )b 
    Thanks,
    Joseph

  • 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

  • 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 

  • Query regarding Opened/Closed GL periods

    Hello Gurus,
    ive got an issue, when using 0FIGL_C01 Cube.
    The query ive created balances on cumulative balance (as key figure) and GL account names (as hierarchy).
    Now i want to show the data of cumulative balance regarding closed periods.
    I.e. if we have current April month the balance should be 0, but all other in the past January, February, March should be displayed.
    How it is possible to do this?
    Ive tryed to create a calculated key figure, whith code something like:
    IF debit and credit == 0 then Cummulative balance=0 else Cumulative balance.
    It works fine but it shows also the postings of current period, which isnt realy closed.
    Tried to search the indicators of FI open/closed periods, but the only thing i found is S_ALR_87003642 - Open and Close Posting Periods transaction showing Company code, GL account ranges and from to period data.
    What could be the sollution for this? Should i create new DS for the mensioned TC and then to create a multicube or perhaps is a better and faster way in doing it?
    Thanks a lot in advice
    Laurynas Prikockis

    Hi Shrikant,
    >
    Shrikant Varma wrote:
    > Yes, I could consider using belnr selection to reduce the size of the selection. This will again be a selection more
    > based on knowledge of application(of course with fine tuning of packet size).
    >  But then this approach will not be as efficient and as easy as letting database take control of the iteration of this
    > huge dataset - as is intended by the use of cursors with the help of packet size.
    >
    I'm not sure what you mean here: "let the database contorl the iteration of this huge dataset - with cursors".
    Generally speaking you have 2 options when it comes to parallel processing:
    Parallelize processes in the ABAP stack. These processes access different, non-overlaping, parts of your restult set
    in parallel. Using the BELNR could be an approach to build different, non-overlapping paackages.
    Database side parallelization. This is possible for every action that uses multiblock I/O (full table scans and index fast full scans) and for partitioned segments. For non-partitioned segments and single block I/O database side parallelization is not possible.
    So, generally speaking, you have 3 options:
    1.) parallelize in ABAP and build idependent packages
    2.) force the DB to do multiblock I/O (full table scan, index fast full scan) in parallel
    3.) partition your table and indexes.
    I think (it's just my opinion) for an ERP (not BW / BI) system
    - option 3 is not a good option for OLTP systems (several reasons). I see it very, very, very rarely or close to never in OLTP systems
    - option 2 may read (much) more data then you would need to read, although a very efficient I/O method would be used (multibock I/O)
    - option 1 requires programming in ABAP but will read exactly the data you need to read and can be controlled very well in the ABAP stack (parallel single block I/O will be used)
    In alamost all cases (that are similar to your case) i have see option 1 was used.
    Kind regards,
    Hermann

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

  • Best practice for opening/closing JDBC conection

    I've written a program that accesses a database, and I'd like to know the best practice for opening and closing that connection. For example should I use a try{} finally {} block,
    try
        //load driver
        //create conection
        //create statement object
        //sql statement to execute
        //execute statement
    finally
        //close connection
    }Or should I split the code into seperate methods, maybe an init() method that loads the driver and makes the connection and an execute() method that creates the statement and executes it and finally a cleanUp() method that closes the connection.
    So, which would be the best way to do this?

    Hallo,
    your idea seems OK to me. However, there are a couple of points to consider:
    1. Do you just want to execute one SQL query? Or will your program execute several? If the latter case is possible, then you do not want to close your connection between queries. Opening and closing a connection to a database takes 'a lot of time', relatively speaking. In this case, it is better to save the connection and reuse it every time that you need it.
    2. Do not forget to close the statements and result sets that you create or get back from JDBC. Depending on the database (eg Oracle) that you are using, you can run out of cursors, and your application will stop.

Maybe you are looking for

  • Is there a way to automatically add lines to an existing PO.

    Not using auto create, thru standard or private APIs can me systematically insert new lines into an existing PO? For example consider the following scenario: ASCP Releases demand thru a Requisition. Requisition Imports into EBS and Creates a PO throu

  • Sharing calendars in a small workgroup, basic set up questions

    I am getting no where with the new leopard server and ical server. we have an all mac office, new leopard server and are trying to make the ical server work so that users on the network can see and share each others calendars. the level of documentat

  • How do I connect my ancient G3 to the internet?

    Hi. I need to get online with my old Powerbook G3 Series running Mac OS 8.1. Internet connection would be via a Motorola SB5100, or the PC that's currently connected to it. Can it be done? Otherwise what are the options to connect to the internet? Th

  • Info about Table Filter

    hi, i am developing a webdynpro application which uses adaptive rfc model to fetch data from R/3. The data is getting populated in a table. Now i need to filter this table according to a particular value(eg user id) and then display the filtered data

  • How to use FC lun as a repository.

    Background info I m using Oracle VM 3.2.2. # cat /etc/redhat-release Oracle VM server release 3.2.2 Server pool is having 2 Servers ( With 3 local repositories mounted on them) . Is there any way i can mount one more FC lun repository on one of VM se