Stock Counted Query

Hi Guys,
Am trying to write my own report based on the Stock Tracking Report in SAP. To be honest the standard system report is not very helpful or user friendly if you have a large amount of stock due to it reporting all your stock on the report as the stock can potentially exist in any warehouse as I understand it.
Below is what I have so far but I am unsure of the field that records and shows the variation in the count and what is reported in stock. Could someone point me in the right direction as I wish to redesign all the stock reports and convert them into Crystal Reports to make them more user Friendly for my Staff.
Thanks for any help in advance
SELECT T0.[ItemCode], T1.[ItemName], T0.[WhsCode], T2.[WhsName], T1.[DfltWH], T0.[OnHand], T0.[Counted], T0.[WasCounted] FROM OITW T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OWHS T2 ON T0.WhsCode = T2.WhsCode WHERE T2.[WhsName] =[%0] AND  T0.[Counted] <> '0'
Regards
Sean Martin

Hi Gordon,
Thanks for looking, I want to include in the report/query the actual difference between what is currently in stock and what has been counted - for example if I have 100 showing in stock but I only count 80, the Difference column should show -20.
I also need to report the stock unit value with a total for the difference variation, but am also unsure which table stores that information.
Thanks again Gordon
Edited by: Sean Martin on Jan 10, 2011 5:08 PM

Similar Messages

  • Open interface for physical stock counts

    Dear All,
    I need to know whether there are any open interface available for physical stock counts.
    Version 11.5.10.2
    Regards,
    MPH

    Hi MPH
    The Cycle Count API is a public API & it takes a cycle count interface row that has been passed through the p_interface_rec parameter and processes it based on the values of the parameter fields. The Cycle Count API includes the public procedure import_countrequest.
    Cycle count API Parameters are as below
    p_api_version_number
    p_init_msg_list
    p_commit
    p_validation_level
    x_return_status
    x_msg_countx_msg_data
    p_interface_rec
    Hope this will help.
    Regards,
    S.P DASH

  • Transaction Code for Stock counting in SAP WM

    Can anyone let me know the transaction code in SAP WM to view list of all differences during stock counting process
    Thanks in advance.

    Hi,
    To view the list of differences during counting of the inventory document you can use transaction "LI13N-Display Inventory count"
    LI20 is used to clear differences in WM
    LI21 is used to clear IM differences after LI20
    So use LI13N to know the history of your counting.
    Hope this is what you looking for.
    Regards,
    Prashant

  • Vendor consignment pick up value when doing stock count

    Hi experts!
    I'm seeking your kindness to help me solve a problem.My client has done a stock count of vendor consignment stock.But why the system pick up the value of the stock when they do adjustment to the system which this item should not have any value as it was under vendor consignment?
    When i go to MI20 to check display the list of inventory differences,there's 1200kg with total price rm5146. the qty suppose to be no value but why there's 1200kg in booking?
    Any idea? your help is much much appreciated..

    Hi Pardeep,
    I still can't solve this problem.. Please help me.
    My client did stock count for vendor consignment stock. The problem is the system pick up value when she  did that. It suppose to be no value since it's not their stocks. but then i notice that there's a posting via mvt type 702 at the same day. i suspect she did not freez the invetory book during stock count. So now she doesn't want the value to be picked up. What can i do to solve this? Should i advise her to do reverse mvt type - 701? Please help me ASAP..

  • How to display stock count on partlist page

    Hi everyone
    Can anybody tell me which aspx or ascx file I need to modify in order to display the stock count on the partlist page where now only presents Image PartNo     Description Price and AddtoCart button.
    Thanks and regards
    Sky

    hi sky,
    here is one possible solution - because I am not sure it's possible to do what you want to do with the supplied controls, as you have no access to the codebehinds.
    Instead, rewrite the PartListblock.ascx to function exactly the way you want to (it's really just a table of data). I've been doing this with my own setup because I find a lot of the time I just can't get the exact functions that I need using the builtin controls.
    Here is an example (very basic) of how you could do it.
    Create a new Web User Control in the catalog/controls folder.
    This would be the .ascx file: (using C#)
    (note I am using .NET 2.0, its OK as long as you also have .NET 1.1 installed on the server as well I have found you can create your own controls using 2.0 and Netpoint will still work fine)
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyPartsListBlock.ascx.cs" Inherits="catalog_controls_MyPartsListBlock" %>
    <%@ Import Namespace="netpoint.api.catalog" %>
    <asp:Repeater ID="repItems" runat="server">
    <ItemTemplate>
    <table>
    <tr>
    <td><%#((NPPart)Container.DataItem).ThumbNail %></td>
    <td><%# ((NPPart)Container.DataItem).PartNo%></td>
    <td><%# ((NPPart)Container.DataItem).Inventory %></td>
    <td>Buttons etc</td>
    </tr></table></ItemTemplate>
    </asp:Repeater>
    and here is the codebehind for the control: (MyPartsListBlock.ascx.cs)
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using netpoint.classes;
    using netpoint.api.catalog;
    public partial class catalog_controls_MyPartsListBlock : System.Web.UI.UserControl
        private int catID;
        protected void Page_Load(object sender, EventArgs e)
            //get the CategoryID that was passed into us
            catID = Convert.ToInt32(Request["CategoryID"]);
            //get the page object
            NPBasePage p = (NPBasePage)Page;
            //now get the list of parts for the catalog category we are in
            ArrayList parts = p.Catalog.CategoryParts(catID, p.UserID, p.PriceList, p.Encoding);
            //initialise each part's Inventory count
            foreach (NPPart temp in parts)
                temp.GetInventoryCount(p.UserID);
            //finally bind them to the repeater
            repItems.DataSource = parts;
            repItems.DataBind();
    If you want to use only .Net 1.1 then take out the "Codefile" reference in the first section and put in 2  @Import directives to import the netpoint.api.catalog and netpoint.classes namespaces, then override Page_Load in the ascx file.
    Once you have tested this you can then replace the control on the partslist.aspx with your own control.
    I am assuming you are familiar with asp.net - as you can see all I've done is put in a very basic repeater here which is bound to an ArrayList of NPParts, this list is initialised by getting the CategoryID Request variable and just using the builtin methods of the NPBasePage to get tye list of items
    This way you get total control over the ability to call GetInventoryCount() on the items in the list.
    Obviously you will want to put more elements like images and links into the Repeater's ItemTemplate, but that's just the usual, you can override repItems_OnDataBound to set the image path and the links as each row in the repeater is created, etc.
    Hope this helps, and sorry if its confusing but it will work for you if you just take some time with it.
    Steve

  • Incorrect count query

    I'm using CursoredStream to fetch a large result set. When doing a cursor.size() Toplink generates the wrong count query. I do have group value functions in the query as shown below.
    For e.g. this is the cursor query:
    --- Actual select query ---
    SELECT t0.AWARD_ID, t0.AWARD_NUMBER, t0.FINAL_AMOUNT, t2.NAME,
    SUM(t1.REPORT_AMOUNT), t4.FISCAL_YEAR, t5.DESCRIPTION
    FROM REF_ENTITY t6, T_CODE t5, SOL t4, APP t3, APP_VERSION t2, SUBG t1,
    AWARD t0
    WHERE ((((t4.FISCAL_YEAR = '1993') AND (t6.REF_ENTITY_ID = 5)) AND (t4.SUBG_
    REPORT = 'Y')) AND ((t5.T_CODE_ID = t0.T_CODE_ID_STATUS) AND ((t2.APP_ID = t3.A
    PP_ID) AND ((t6.REF_ENTITY_ID = t4.REF_ENTITY_ID) AND ((t4.SOL_ID = t3.SOL_ID)
    AND ((t3.APP_ID = t0.APP_ID) AND (t0.AWARD_ID = t1.AWARD_ID)))))))
    GROUP BY t0.FINAL_AMOUNT, t0.AWARD_ID, t0.AWARD_NUMBER, t4.FISCAL_YEAR, t5.D
    ESCRIPTION, t2.NAME ORDER BY t0.AWARD_NUMBER ASC
    The count query generated by Toplink is:
    SELECT COUNT(*)
    FROM REF_ENTITY t4, AWARD t3, APP t2, SOL t1, SUBG t0
    WHERE ((((t1.FISCAL_YEAR = ?) AND (t4.REF_ENTITY_ID = ?))
    AND (t1.SUBG_REPORT = 'Y')) AND ((t4.REF_ENTITY_ID = t1.REF_ENTITY_ID)
    AND ((t1.SOL_ID = t2.SOL_ID) AND ((t2.APP_ID = t3.GMS_APP_ID)
    AND (t3.AWARD_ID = t0.AWARD_ID)))))
    I have to provide my own ValueReadQuery to get the correct count in the above case. Are there any rules for determining when we have to explicitly provide our own count query?
    cheers
    p.s: Toplink version 9.0.3.4

    Abe,
    This sounds like a bug. I assume you are using a ReportQuery to generate the initial SQL. You should only have to provide a ValueReadQuery to a cursored query when using SQL, stored-procedure, or to optimize what is being generated.
    This looks like the group-by on your ReportQuery is being ignored on the size query. The best plan is to submit this to support with the TopLink code used and the information provided in this post.
    In the mean time the work-around of providing your own query is probably the best solution.
    Doug

  • Count Query Performance

    How can we improve the perfromace of a count query?
    Suppose I have a table A that holds more than 50 million rows.
    Now if i want to count the no of rows which is the best one
    1) Select count(*) from A.
    Definitely not as it is doing a full table scan
    2) Select count(primary_key) from A.
    3) Select count(row_id) from A.
    One more question whats the difference between select count(*) from table_name and select count(1) from table_a. Many people suggest count(1) and i dont see any reason though.
    Kindly guide me.

    > Please see my points 1,2 and 3.
    Can this change the execution plan (path) of the CBO in anyway?
    1. count rows
    2. count rows using primary key
    3. counting rows using physical row addresses
    The fact is that the rows, and all the rows, need to be counted. The CBO will choose the most "attractive" I/O path - i.e. the smallest one, the one with the least amount of I/O. It does not need tricks like COUNT(1) or COUNT(PK) or COUNT(ROWID) in order to make an appropriate decision.
    Example:
    SQL> create table tab1 nologging as select level as ID, LPAD('*',4000,'*') as STUFF from dual connect by level <= 10000;
    Table created.
    SQL> set autotrace on
    Running a SELECT COUNT(*) without any alternate I/O paths (no indexes exist)
    SQL> select count(*) from tab1;
    COUNT(*)
    10000
    Execution Plan
    Plan hash value: 899213575
    | Id | Operation | Name | Rows | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 2306 (4)| 00:00:28 |
    | 1 | SORT AGGREGATE | | 1 | | |
    | 2 | TABLE ACCESS FULL| TAB1 | 9982 | 2306 (4)| 00:00:28 |
    Note
    - dynamic sampling used for this statement
    Statistics
    28 recursive calls
    0 db block gets
    10087 consistent gets
    10000 physical reads
    0 redo size
    208 bytes sent via SQL*Net to client
    238 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    Creating an PK index
    SQL> alter table tab1 add constraint pk_tab1 primary key(id) using index;
    Table altered.
    Running the same SELECT COUNT(*) - but the CBO now sees that the PK index
    is smaller and cheaper to scan than scanning the table
    SQL> select count(*) from tab1;
    COUNT(*)
    10000
    Execution Plan
    Plan hash value: 1796789124
    | Id | Operation | Name | Rows | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 9 (23)| 00:00:01 |
    | 1 | SORT AGGREGATE | | 1 | | |
    | 2 | INDEX FAST FULL SCAN| PK_TAB1 | 9982 | 9 (23)| 00:00:01 |
    Note
    - dynamic sampling used for this statement
    Statistics
    194 recursive calls
    0 db block gets
    131 consistent gets
    20 physical reads
    0 redo size
    222 bytes sent via SQL*Net to client
    238 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    5 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>

  • Stock Statement Query

    Hi All,
    Can some one help me in writing the stock statement query which includes
    Warehouse Code, Inventory Transfer No, Inventory Transfer Date, Item Code, Item Description, Batch No/Serial No, Expiry date, Delivery Note No if any
    We have add on which links the Inventory Transfer to Delivery. We can copy the inventory transfers to delivery where inventory transfer no will be stored in the item level UDF (u_delno)
    Thanks in advance

    Try from here to start:
    Select T1.WhsCode, T0.DocNum, T0.DocDate, T1.ItemCode, T1.Dscription, T1.SerialNum, T1.u_delno
    FROM dbo.OWTR T0
    INNER JOIN dbo.WTR1 T1 ON T1.DocEntry = T0.DocEntry
    Thanks,
    Gordon

  • Stock Counting - Serial No Add

    Dear All,
    I am writing an add-on to populate stock counting details into sap b1. In Serial Numbers Setup screen, While clicking "Update from My stock take" button, I add serial no details to sap serial no matrix. But, when I click Update button, It raises an error saying that serial no in line2 already exists. But, It is not available in sap. Though I change new serial no , it does not update.
    I am attaching the screen shot for your reference.
      Please refer below my code.     
    oMatrixC = oForm.Items.Item("3").Specific
    iRowCount = 0 
           If ors.EoF = False Then           
           ors.MoveFirst()             
         Do While Not ors.EoF        
                oForm.Freeze(True)     
                     oEdit = oMatrixC.Columns.Item("1").Cells.Item(iRowCount + 1).Specific   
                       oEdit.Value = ors.Fields.Item("MfrSerialNo").Value.ToString         
              oEdit = oMatrixC.Columns.Item("54").Cells.Item(iRowCount + 1).Specific       
                   oEdit.Value = ors.Fields.Item("SerialNumber").Value.ToString            
             oEdit = oMatrixC.Columns.Item("53").Cells.Item(iRowCount + 1).Specific          
                oEdit.Value = ors.Fields.Item("LotNo").Value.ToString         
               oEdit = oMatrixC.Columns.Item("51").Cells.Item(iRowCount + 1).Specific          
                oEdit.Value = ors.Fields.Item("ExpiryDate").Value.ToString       
                oEdit = oMatrixC.Columns.Item("50").Cells.Item(iRowCount + 1).Specific       
                  oEdit.Value = ors.Fields.Item("MfrDate").Value.ToString     
                  oEdit = oMatrixC.Columns.Item("49").Cells.Item(iRowCount + 1).Specific           
               oEdit.Value = ors.Fields.Item("AdmissionDate").Value.ToString           
                oEdit = oMatrixC.Columns.Item("48").Cells.Item(iRowCount + 1).Specific          
                oEdit.Value = ors.Fields.Item("MfrWarrantyStart").Value.ToString           
               oEdit = oMatrixC.Columns.Item("47").Cells.Item(iRowCount + 1).Specific     
                     oEdit.Value = ors.Fields.Item("MfrWarrantyEnd").Value.ToString          
               If ors.RecordCount <> iRowCount + 1 Then      
                        oMatrixC.AddRow(1, iRowCount + 1)        
                  End If              
             oForm.Freeze(False)           
                               iRowCount = iRowCount + 1      
                    ors.MoveNext()   
              Loop     
             End If
    Could any one help please.
    Thanks,
    Manikandan

    Please post to SAP Business One Application
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • General stock statement query.

    hi ,
         can anybody help me in getting stock statement query.... no selection criteria it has to disply all the ware house with Opening stock......inward qty, outward qty,closing stock . (this general) and like this i have to get stock details date wise

    Hi Vignesh......
    I'm in confusion. You are asking the same question with different meanings.
    As you are already suggested to use Inventory Posting List. You get all of your answers to your question.
    It will give you the stock Opening, In, Out, Closing Warehouse Wise (Particular/All), Date wise, Transaction wise...
    Please check this path to refer This Report.
    Inventory->Inventory Reports-->Inventory Posting List......
    If you have different requirement then please do mention.
    Regards,
    Rahul

  • Stock statement query--- help

    Have any one got the stock statement query report in the folowing format....
    1.ItemCode
    2.Item Description
    3.Item Price
    4.Opening
    5.Receipts
    6.Issues
    7.Closing
    8. Value
    The selection criteria are:
    3.Posting Date
    from wh
    to wh
    help me in making stock statement query
    regards,
    Vignesh

    Hi
    Check This
    select w0.itemcode, i0.docdate, w0.whscode, w0.onhand - isnull (sum (i0.inqty - i0.outqty), 0), 0
    from oitw w0 left outer join oinm i0 on w0.itemcode = i0.itemcode and w0.whscode = i0.warehouse
    where i0.docduedate >= [%0]
    group by w0.itemcode, w0.whscode, w0.onhand, i0.docdate
    having w0.itemcode = [%1] and w0.onhand - isnull (sum (i0.inqty - i0.outqty), 0) >= 0
    union
    select w0.itemcode, i0.docdate, w0.whscode, 0, -(w0.onhand - isnull (sum (i0.inqty - i0.outqty), 0))
    from oitw w0 left outer join oinm i0 on w0.itemcode = i0.itemcode and w0.whscode = i0.warehouse
    where i0.docduedate >= [%0]
    group by w0.itemcode, w0.whscode, w0.onhand, i0.docdate
    having w0.itemcode = [%1] and w0.onhand - isnull (sum (i0.inqty - i0.outqty), 0) < 0
    or
    SELECT T0.ITEMCODE, T0.DSCRIPTION,T0.OPENQTY, T0.OPENVALUE, T0.INQTY, T0.INQTY*T0.PRICE AS 'RCPT VAL', T0.OUTQTY,T0.OUTQTY*T0.PRICE AS 'ISS. VAL', T0.INQTY-T0.OUTQTY AS 'CLOSING STOCK QTY',((T0.INQTY-T0.OUTQTY)*(T0.CALCPRICE)) AS 'CLOSING STOCK VAL' FROM OINM T0 WHERE T0.DOCDATE >=[%0] AND T0.DOCDATE <=[%1]
    Thanks
    Kevin
    Edited by: Kevin Shah on Oct 23, 2010 5:37 PM

  • Count query taking time

    I have a query -->select c1,c2,c3 from table1 . This query takes only few milliseconds. But when I take count from the same query i.e. when I execute select count(c1,c2,c3) from table1 then it takes a very long time (about 1 min). The table1 contains about 25000 rows. Please help to improve performance of Count query.

    Satej wrote:
    I have a query -->select c1,c2,c3 from table1 . This query takes only few milliseconds. But when I take count from the same query i.e. when I execute select count(c1,c2,c3) from table1 then it takes a very long time (about 1 min).Classic misperception of Toad, SQL Navigator and similar tool users. All these tools fetch just first result screen and show time it took to fetch just that and not the time to fetch all rows. And in order to count you need to fetch all rows.l That is why select count(*) takes longer. But 1 min for 25000 rows is a bit long. Check execution plan to see what is going on.
    SY.

  • Stock count clearing LI21 and missing serial numbers

    Hello Experts,
    We are running a stock count and we have come to the stage where we run LI21 to clear differences. However, I cannot do it because I get the error message "Maintian serial numbers for the total quantity".
    The materials that give this message have a serial number profile that requires serial number at the point og GR and GI.
    I am not able to find a way to enter serial numbers in LI21.
    Any suggestions on how to complete my stock count?
    rgds
    GAR

    Check OSS note 409544 - Serial Number Inventory for WM-Administered Storage Location
    and
    484788 - LX23: Workaround for clearing difference with serial numbers
    Edited by: Jürgen L. on Oct 28, 2008 8:33 AM

  • Stock count - consignment stock

    Hi
    Can someone plase provide me with the stock count procedure for consignment stock. Particular attention should be on the following
    1. transactions to be used
    2. reports that needs to be run before it commences
    3. what needs to be done to the system and freezing of booked stock
    4. how to check for old documents that are open or partky posted
    5. variance reports
    6. recount process
    7. final reports
    8. how to make system operational again
    9. what happens to the variances - Is there a finanacial implication
    Kind regards
    Vishnu

    Hello Vishnu,
    I have created thread for new guys who wants to be in MM/WM, this thread covers most of the basic questions, so please go through for general queries on MM/WM.
    New to Materials Management / Warehouse Management?
    btw, I have blogged on the physical inventory process in Inventory management. This will be more helpful for the new guys in the area of SAP / Material management.
    <a href="/people/community.user/blog/2007/05/04/physical-inventory-in-material-management Inventory Process in Material Management</a>
    Hope this helps.
    Regards
    Arif Mansuri

  • How to Input quickly year-end Stock Count Results

    Gurujee,
    Our company has 3 sites for inventory which is holdin  about 2,000 SKUs (Stock Keeping Units) value with 100 M Dollars. 
    Please educate me how to quickly input stock count results in matter of say 12 hrs - i.e. between december 31, 2009 and start new year January 1, 2010.
    How to do up and down adjustments QUICKLY within same categories, e.g. in Drinks up and down adjustments for items with similar values, but different flavors ?
    Rgds,
    Seifudin

    Ah, but I am unsure as to which part of my code goes where "..." is.
    Is it basically everything that I have put in the for loop?
    Right, I tried the following code:
    import java.util.Scanner;
    /* This program displays pass results for students */
    class StudentMarks
         public static void main (String[]args)
              Scanner input = new Scanner(System.in);
              int x, noOfStudents, mark;
              System.out.println ("Input number of students");     //outputs text
              noOfStudents = input.nextInt();
              while ((mark = input.nextInt()) != -1)
                  for (x = 1; x <=noOfStudents; x++) //loops no. of times of no. students
                             System.out.println ("Input exam mark for student");
                             mark = input.nextInt();
                             if (mark >= 40)
                                  System.out.println ("Pass");
                             else
                                  System.out.println ("Fail");
    }I don't know if this is the right way of going about it, but I am having a problem with it. When it asks me to input the number of students, I enter a number, but I have to enter it a second time for it to go to the next section, which is to ask for the mark. It then repeated the question of how many marks until I entered -1 to stop the program. So the number of students input is disregarded.
    So I can only assume I've put the wrong part of the code where "..." was? I really don't know where to go with this so if someone could just put on the right lines here, that would be great, thanks!

Maybe you are looking for

  • Can anyone help with intermitent blurring on videos.

    My video is done.  Many parts are good and many are now intermitingly blurry.  Can anyone help?  Am using a good camera.  Have done one video before and it turned out good.  The video from the camera is not blurry at all.  Just now.  I need help. Usi

  • Problem using updatable ResultSet

    I am using scrollable and updatable result sets to query and modify data. The problem I am having is that when I make a change to the data in a field on my form, the data gets modified in the database and not in the result set in my form. This only o

  • UPDATE CURRENT Problem

    I am using Oracle8i Release 8.1.6.0.0, and now I encounter an error when running the following PL/SQL Block: 1 declare 2 cursor c1 is 3 (select k1, f1 from geotab1) 4 for update of f1; 5 cursor c2 (key_k1 in geotab1.k1%type) is 6 (select f2 from geot

  • HT1688 Do you sell just the iPhone 5 in the retail stores at all?  All that I see online are 5c, 5s or 4s's.

    Do you offer the iPhone 5 in stores or online?  All that I see are the 4s's, 5c's and 5s's.

  • Feel bad for asking this but

    I'm new to this forum and only just bought an 80GB iPod classic. Anyway, I don't actually like the menu displays. I never put cover art on my iPod and it also annoys me when you see a track and instead of the cover art it comes up with a grey box and