Inactive Stock query

Client needs a report for inactive stock - that is any stock that has shown no movement for a certain period in the past
(sales orders, deliveries, invoices, credit notes).
The fields required are - ItemCode, ItemGroup, Warehouse, Last Purchase Price, StockValue
The standard report in SBO (Inactive Items) does not give all the required info and I have no idea how to go about this.
Can anyone help with a query please?
Regards

Dear Mr Gijzen,
I wrote the wrong report name. I was thinking about the Inventory Valuation Report.
In the selection criteria you can choose Calc. Method by Price list and choose Last Purchase price under Price source.
The columns of this report are the warehouse, the item, the quantity, the cumulative value according the criteria you have previously chosen and the system date.
Please, note that this report is used for managerial reasons and will not update the change the valuation method chosen for the items.
Apologies for the previous mistake.
Regards,
Marcella Rivi
SAP Business One Forums Team

Similar Messages

  • Inactive stock

    Hi - Below is my original thread with the solution kindly provided by Gordon.
    Client needs a report for inactive stock - that is any stock that has shown no movement for a certain period in the past
    (sales orders, deliveries, invoices, credit notes).
    The fields required are - ItemCode, ItemGroup, Warehouse, Last Purchase Price, StockValue
    The standard report in SBO (Inactive Items) does not give all the required info and I have no idea how to go about this.
    Can anyone help with a query please?
    I forgot to mention that the client is on FIFO and Gordon provided the query below -
    SELECT T0.ItemCode, T2.ItmsGrpNam, T0.WhsCode, T1.LastPurPrc, T0.OnHand*T0.AvgPrice 'Stock Value'
    FROM dbo.OITW T0
    INNER JOIN dbo.OITM T1 ON T1.ItemCode = T0.ItemCode
    INNER JOIN dbo.OITB T2 ON T2.ItmsGrpCod = T1.ItmsGrpCod
    WHERE T0.Onhand > 0 AND T1.ItemCode NOT IN (SELECT Distinct T3.ItemCode
    FROM OINM T3 WHERE T3.DocDate Between [%0] AND [%1]
    AND T3.TransType BETWEEN 13 AND 17)
    My concern is the following - The client changed over from 'Moving Average'  to 'FIFO' about  2 years ago. Is the 'stock value' still determined by multiplying Onhand with AvgPrice in case of FIFO? I have noticed that there is a field 'StockValue' in OITW. Won't that field be the correct one to use in the above query?

    Hi,
    By FIFO method, you should first track last remaining qty in the OINM table. Total value will be sum of Price * Qty of every remaining FIFO layer (just like FIFO concept).
    Cheers

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

  • Blocked Stock query

    In help.sap.con the description of the Blocked stock query includes:
    "The vendor consignment stock and the returnable transport packaging are non-valuated; therefore there are no associated stock value key figures for these quantity key figures."
    What does this mean? Thanks

    This means that it doesn't make sense to have a value for a stock that...is not yours !!!
    Consignement stocks and returnable transport packaging are not on your property, so, you can monitor them only about qty, but not about their values...
    Hope now is clearer...
    Bye,
    Roberto

  • 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

  • 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

  • Zero stock query

    hi experts,
    how can i make a query that will display all items with zero stock?
    I have tried linking OITM and OITW('manage by warehouse' is selected), and using the 'onhand' attribute, but with no success. 
    thanks
    Michael

    hi all,
    thank you for your prompt answers.  However this not what i am really looking for.  I have already tried all the proposed solutions.
    I need a query that will give all items with a sum of zero stock from all warehouses. 
    The reason is that i need to update each item so that it does not require the use of 'batches' anymore.  And to do this, i need to be able to identify all items with zero stock from all warehouses, so that i can update them.
    thanks
    Michael

  • Sales BOM stock query

    Hello,
    I' am looking for a query wich gives me a report of the sales bom item with the total amount of stock of the salesbom item with the child items underneath it.
    Thanks
    Mark

    Sales BOM is not a stock item.  Therefore, there is no logic to count the Sales BOM stock.  However, if you like to know the virtual quantity of those quantities, you could try query like this:
    Select t1.Father, min(t2.onhand) 'On Hand'
    from dbo.oitt t0
    inner join dbo.itt1 t1 on t1.father = t0.code
    inner join dbo.oitm t2 on t2.itemcode = t1.code
    where t0.TreeType = 's' and t0.code like '[%0\]'
    group by t1.father
    Thanks,
    Gordon

  • Stock query

    Hi Experts
    I need to come up with a query that will show all items in a selected warehouse for a given month which will show opening stock quantity, the quantity sold,  quantity transfered and closing stock quantity.
    Any guidence on this would be great
    Thank you
    Regards
    Apsara

    Hi Apsara.....
    Please check this thread....
    http://wiki.sdn.sap.com/wiki/display/B1/SAPB1SQLH-INItemInventoryOpeningandClosingStockper+warehouse
    Hope this may help you..........
    Regards,
    Rahul

  • STOCK query for audit

    Hi people
    I have a query regarding the stock
    im from garment industry
    i have a fabric store location 0001
    cutting location 0002
    stiching loc 0004
    finishing loc 0006
    ware house loc 0010
    i have a sales order of order qty 1000
    production orders for cutting, stiching finishing were made for 1000 pcs in system
    cutting material was consumed by stiching material by 261e movment type
    stiching material was consumed by finishing material by 261e movment type
    Used T-code
    coois
    co11n
    mb31 -101 movment type
    Mb1b - transfer posting 311e
    now the scene is
    physically we made only 900 pcs and in system the stock is showing 1000 pcs
    how can i compensate the difference of 100 pcs?
    someone suggested me do the reverse bu mb31 using 102 movment type for 100 pcs
    but  will that not show increase in WIP stock?
    will not it effect the accounting entries
    some one told me use the movment type for scrapping
    buti need to clear the stockin many sales order
    please advise wht should be done

    Hi dear,
    As you said you have 900 PCs physically and in system 1000 PCs are confirmed this is contradiction.You have to reverse the 100 PCs so that physical quantity and confirmed quantity in the system will be same even though reversal will hit the accouting entries.Wont you asked by auditor for the difference seen in physical quantity and confirmed quantity in COOIS? How would you justify the variace of 100 PCs?

  • How can i create Inventory FIFO (FIRST IN FISRT OUT ) stock query ?

    I want to create  Inventory FIFO query from this
    I have a receive item table to store the receive item (IN) and i have requisition table  (OUT).
    I want to create a FIFO query  order by
    receiveID , the output i expect is
    How can i do this ?

    declare @Stock table (Item char(3) not null,[Date] datetime not null,TxnType varchar(3) not null,Qty int not null,Price decimal(10,2) null,ReqNo varchar(4) null)
    insert into @Stock(Item ,  [Date] ,        TxnType, Qty,  Price , ReqNo) values
    ('ABC','20120401','IN',    200, 750.00 ,null),
    ('ABC','20120405','OUT',   100 ,null , 'R001'  ),
    ('ABC','20120410','IN',     50, 700.00 ,null),
    ('ABC','20120416','IN',     75, 800.00 ,null),
    ('ABC','20120425','OUT',   175, null  , 'R002' ),
    ('XYZ','20120402','IN',    150, 350.00 ,null),
    ('XYZ','20120408','OUT',   120 ,null  , 'R003' ),
    ('XYZ','20120412','OUT',    10 ,null  , 'R004' ),
    ('XYZ','20120424','IN',     90, 340.00 ,null);
    ;WITH  RunningTotals as (
    select A.Item , A.Qty , A.Price ,  A.Total , total - A.qty AS PrevTotal,  rn FROM (
    select 
    Item , qty , Price
    , SUM(Qty) over (PARTITION BY Item order by [Date] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as total 
    ,ROW_NUMBER() OVER (PARTITION BY Item ORDER BY  [Date] ) as rn
    ,[Date]  
    from @Stock where TxnType = 'IN' )  A 
     )-- Select * from  RunningTotals    -- >> Sort FIFO by date
    , TotalOut as (
        select ReqNo , Item,SUM(Qty) as Qty  from @Stock where TxnType='OUT' group by Item , ReqNo
    ) Select * from TotalOut -- >> Item that out FIFO
    I want to get the price of any item in any ReqNo from RunningTotals by FIFO

  • Performance effect of hierarchy in the query

    HI Expert,
    We can filter value successfully in the 0COSTCENTER field in the query, 0COSTCENTER as a row and the hierarchy is active, but when the hierarchy is inactive the query get freeze when we filter value. We tried to replicate the issue on other query characteristic like 0Material and we did not get any problem. Anyone know why it is taking to long to filter when the hierarchy is active?
    Thank you so much for your help advance.
    Regards,
    Ted

    Hi Chandamita,
    Thank you so much for your quick response. I'm not sure if it will fix the issue because it has the same properties for other object which we do not encounter the issue.
    Thank you!

  • Query display incorrect data by authorize object

    I have 2 location (1001, 1002).
    And I set 0plant for authorization. I set 'AA' user for display 1002 location.
    I create stock query, that it can input location by 0plant infoobject.
    (New variable -> processing by: Authorize -> selection and optional and ready for input)
    Result:
    Input 1001 -> I receive "No Authorize" -> OK
    Input 1002 -> I receive 1002 data -> OK
    Input 1001,1002 -> I receive "No Authorize" -> Not OK -> I want to display only 1002 data
    No input -> I receive all data both 1001 and 1002 -> Not OK -> I want to display only 1002 data
    please help me
    critical solution is no input case

    Hello A J,
    are you using the (new) concept of analysis authorizations?
    If yes, then think about this important rule: authorizations do not work as a filter. Authorizations define the area that the user is allowed to see, but you still need to define the filters in the query in order to make sure that the query does not select more than the user is authorized to. The variable that you created should help the user filter the data, so it should show you only 1002 in the F4 help, but not 1001. If, however, the user manually enters something out of the authorized area, he should get a "not authorized" error.
    So, in your cases:
    - Input 1001,1002 -> I receive "No Authorize" -> Not OK -> I want to display only 1002 data
    Query tries to select both plants, but the user is only authorized to 1002, so "no authorization" message is expected
    - No input -> I receive all data both 1001 and 1002 -> Not OK -> I want to display only 1002 data
    This should not happen. Are you sure that data for 1001 is also displayed? If yes, check the authorization log via RSECADMIN to see which authorization allows the user to see plant 1001.
    I hope this helps.
    Regards,
    Maxim

  • Stock reserver for sales order

    Dear All
    1. MMBE-Check the stock with batch no 6000000340 with 200 qty
    2. Sale Order Created-
    3. MB1B - Used Movement type 412 E with Inputs such as Sales Order,[warning message: sales order is not provided for this goods movement] after pressing the document is posted
    4. In MMBE When i check the stock under batch no 6000000340  with 150 qty in unrestricted stock and Sales order Stock  i can see the 50 quantity stock
    Query is
    1. Why the 50 quantity stock which is reserved for Sales order stock is seen under unrestricted stock and not under  Reserved tab
    2. When i create delivery  with the same material and  batch no, the stock is reduced from unrestricted stock[150 -10delivery qty] = its showing 140 qty, but stock should be reduced from 50 quantity which i have reserved for Sales order.
    Please guide
    Regards
    Sandeep Bhowmick

    Hi Sandeep
    Visualize this scenario
    Material is pen in MMBE unrestricted stocks is 100
    Sales order created with item cat TAN with special stock indicator E not marked and the order no is say 55 for 10 qty
    Now you are reserving stocks in t code MB1B with movement type 412 E inputting the order no xx and saving it
    Now in MMBE put the material as pen and input plant and storage location etc press F8
    unrestricted stocks will be 90
    Sales order stocks will be 10
    If you click on the details of this sales order stocks you will see the order no xx and qty will be 10
    (read your first post exactly the same of this)
    now are delivering the sales order and doing the pgi
    Now in MMBE
    unrestricted stocks will be 80
    Sales order stocks will be 10 (this exactly is your problem)
    that means the system having a reservation in MMBE for a particular sales order xx not utilizing those stocks and still takes the stocks from the unrestricted and this is wrong
    This is happening because the item cat TAN is not marked with special stock indicator E during order creation of xx
    Now mark the item cat TAN with special stock indicator E and create a fresh cycle say order no yy
    When you do PGI for order no yy the unrestricted will be 90 and there wont be any sales order stocks as the stocks are already PGIed
    That means the system picks up the correct stocks for delivery
    The system behaves very perfectly When there is sales order stocks in MMBE i dont  understand ,what is the reservation you are talking about
    Regards
    Raja

  • How to improve Query Performance

    Hi Friends...
    I Want to improve query performance.I need following things.
    1.What is the process to findout the performance?. Any transaction code's and how to use?.
    2.How can I know whether the query is running good or bad ,ie. in performance praspect.
    3.I want to see the values i.e. how much time it is taking to run?. and where the defect is?.
    4.How to improve the query performance?. After I did the needfull things to improve performance, I want to see the query execution time. i.e. it is running fast or not?.
    Eg..
    Eg 1.   Need to create aggregates.
    Solution:  where can I create aggregates?. Now I'm in production system. So where I need to create? .i.e. indevelopment or in Quality or in Production system?.
    Any chenges I need to do in Development?.Because I'm in Production system.
    So please tell me solution for my questions.
    Thanks
    Ganga
    Message was edited by: Ganga N

    hi ganga
    please refer oss note :557870 : Frequently asked questions on query performance
    also refer to
    Prakash's weblog
    /people/prakash.darji/blog/2006/01/27/query-creation-checklist
    /people/prakash.darji/blog/2006/01/26/query-optimization
    performance docs on query
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/064fed90-0201-0010-13ae-b16fa4dab695
    This is the oss notes of FAQ on query performance
    1. What kind of tools are available to monitor the overall Query Performance?
    1.     BW Statistics
    2.     BW Workload Analysis in ST03N (Use Export Mode!)
    3.     Content of Table RSDDSTAT
    2. Do I have to do something to enable such tools?
    Yes, you need to turn on the BW Statistics:
      RSA1, choose Tools -> BW statistics for InfoCubes
      (Choose OLAP and WHM for your relevant Cubes)
    3. What kind of tools is available to analyze a specific query in    detail?
    1.     Transaction RSRT
    2.     Transaction RSRTRACE
    4.  Do I have an overall query performance problem?
    i. Use ST03N -> BW System load values to recognize the problem. Use the  number given in table 'Reporting - InfoCubes:Share of total time (s)'  to check if one of the columns %OLAP, %DB, %Frontend shows a high   number in all Info Cubes.
    ii. You need to run ST03N in expert mode to get these values
    5. What can I do if the database proportion is high for all queries?
    Check:
    1.     If the database statistic strategy is set up properly for your DB platform (above all for the BW specific tables)
    2.     If database parameter set up accords with SAP Notes and SAP Services   (EarlyWatch)
    3.     If Buffers, I/O, CPU, memory on the database server are exhausted?
    4.     If Cube compression is used regularly
    5.     If Database partitioning is used (not available on all DB platforms)
    6. What can I do if the OLAP proportion is high for all queries?
    Check:
    1.     If the CPUs on the application server are exhausted
    2.     If the SAP R/3 memory set up is done properly (use TX ST02 to find bottlenecks)
    3.     If the read mode of the queries is unfavourable (RSRREPDIR, RSDDSTAT,  Customizing default)
    7. What can I do if the client proportion is high for all queries?
    Check whether most of your clients are connected via a WAN  connection and the amount of data which is transferred   is rather high.
    8. Where can I get specific runtime information for one query?
    1.     Again you can use ST03N -> BW System Load
    2.     Depending on the time frame you select, you get historical data or current data.
    3.     To get to a specific query you need to drill down using the InfoCube  name
    4.      Use Aggregation Query to get more runtime information about a   single query. Use tab All data to get to the details.   (DB, OLAP, and Frontend time, plus Select/ Transferred records,  plus number of cells and formats)
    9. What kind of query performance problems can I recognize using ST03N
       values for a specific query?
    (Use Details to get the runtime segments)
    1.     High Database Runtime
    2.     High OLAP Runtime
    3.     High Frontend Runtime
    10. What can I do if a query has a high database runtime?
    1.     Check if an aggregate is suitable (use All data to get values "selected records to transferred records", a high number here would  be an indicator for query performance improvement using an aggregate)
    2.     o Check if database statistics are update to data for the   Cube/Aggregate, use TX RSRV output (use database check for statistics  and indexes)
    3.     Check if the read mode of the query is unfavourable - Recommended (H)
    11. What can I do if a query has a high OLAP runtime?
    1.     Check if a high number of Cells transferred to the OLAP (use  "All data" to get value "No. of Cells")
    2.     Use RSRT technical Information to check if any extra OLAP-processing is necessary (Stock Query, Exception Aggregation, Calc. before   Aggregation, Virtual Char. Key Figures, Attributes in Calculated   Key Figs, Time-dependent Currency Translation)  together with a high number of records transferred.
    3.     Check if a user exit Usage is involved in the OLAP runtime?
    4.     Check if large hierarchies are used and the entry hierarchy level is  as deep as possible. This limits the levels of the hierarchy that must be processed. Use SE16 on the inclusion tables and use the List of Value feature on the column successor and predecessor to see which entry level of the hierarchy is used.
    5.     Check if a proper index on the inclusion  table exist
    12. What can I do if a query has a high frontend runtime?
    1.     Check if a very high number of cells and formatting are transferred   to the Frontend (use "All data" to get value "No. of Cells") which   cause high network and frontend (processing) runtime.
    2.     Check if frontend PC are within the recommendation (RAM, CPU MHz)
    3.     Check if the bandwidth for WAN connection is sufficient
    REWARDING POINTS IS THE WAY OF SAYING THANKS IN SDN
    CHEERS
    RAVI

Maybe you are looking for