Inventory Report by Query

Dear All,
              I Need  inventory report showing the item code and item description and a UDF. as under
I need to have selection criteria of FROM DATE and TO DATE, and in the report in Row wise it needs to show me the
Following Details of Items.
1) Opening Balances    of (From Date)
2) Received Quantity     In the Period of (From Date and To Date)
3) Issue Quantity           In the Period of (From Date and To Date)
4) FInal Stock                of (To Date)

Saludos 
creo que esto te puede servir
Declare @FromDate Datetime
Declare @ToDate Datetime
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 @Whse = (Select 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

Similar Messages

  • Inventory report that can show min/max

    Dear All,
    Our client is looking for the inventory report for items that fall below the min levels (per warehouse and per item level). Is there an existing report can tell us those info? I cannot find it anywhere in SAP. Thanks.
    Regards,
    Yuka

    Hi Gordon,
    I suggested our client to use a simple user query but they said they were under the impression this was a readily available report. I don't believe there is any but just in case there is any. Thanks for the respond. I will let them know.
    Regards,
    Yuka

  • Inventory reports are not giving output while executing in rsrt

    Hi,
    I am running inventory reports in RSRT. But for every report when i run, a debugger comes and its not showing any output. And the break-point in it is a standard one. so atleast standard reports must execute, but they are not giving me any output.
    Please tell me what can i do to resolve the error.
    Roma

    Hi Roma,
    Just press F8 key and keep executing report .
    Usually Bex Show this when either there is some problem with Report or Some variables you have  used in query  or you have not sufficient memory .
    Run the report and you will definately get some ides.
    key F6 to go to next line of execution
    key F8 to go to next breakpoint .
    Regards,
    Jaya Tiwari

  • Analyse zenworks inventory reports

    Hello,
    We want to use the zenworks inventory to check whick user is installing
    "illegal software" on his pc.
    This by running a software inventory report and comparing the results of
    this inventory.
    This software inventory report give us a very large listing of exe files and
    versions, for example querying all software of Microsoft Incorporated gives
    us 33 pages of different programs.It is nearly inpossible to interpret this
    listings.
    Is there a way to bundle this information of are there programs who can do
    it ?
    Thanks,
    Bearelle Jacques

    Jacques,
    It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at http://support.novell.com in both the "free product support" and "paid product support" drop down boxes.
    - You could also try posting your message again. Make sure it is posted in the correct newsgroup. (http://support.novell.com/forums)
    If this is a reply to a duplicate posting, please ignore and accept our apologies and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Unable to create report. Query produced too many results

    Hi All,
    Does someone knows how to avoid the message "Unable to create report. Query produced too many results" in Grid Report Type in PerformancePoint 2010. When the mdx query returns large amount of data, this message appears. Is there a way to get all
    the large amount in the grid anyway?
    I have set the data Source query time-out under Central Administration - Manager Service applications - PerformancePoint Service Application - PerformancePoint Service Application Settings at 3600 seconds.
    Here Event Viewer log error at the server:
    1. An exception occurred while running a report.  The following details may help you to diagnose the problem:
    Error Message: Unable to create report. Query produced too many results.
            <br>
            <br>
            Contact the administrator for more details.
    Dashboard Name:
    Dashboard Item name:
    Report Location: {3592a959-7c50-0d1d-9185-361d2bd5428b}
    Request Duration: 6,220.93 ms
    User: INTRANET\spsdshadmin
    Parameters:
    Exception Message: Unable to create report. Query produced too many results.
    Inner Exception Message:
    Stack Trace:    at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportWithParameters(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer)
       at Microsoft.PerformancePoint.Analytics.ServerRendering.OLAPBase.OlapViewBaseControl.ExtractReportViewData()
       at Microsoft.PerformancePoint.Analytics.ServerRendering.OLAPBase.OlapViewBaseControl.CreateRenderedView(StringBuilder sd)
       at Microsoft.PerformancePoint.Scorecards.ServerRendering.NavigableControl.RenderControl(HtmlTextWriter writer)
    PerformancePoint Services error code 20604.
    2. Unable to create report. Query produced too many results.
    Microsoft.PerformancePoint.Scorecards.BpmException: Unable to create report. Query produced too many results.
       at Microsoft.PerformancePoint.Scorecards.Server.Analytics.AnalyticQueryManager.ExecuteReport(AnalyticReportState reportState, DataSource dataSource)
       at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportBase(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer, String formattingDimensionName)
       at Microsoft.PerformancePoint.Scorecards.Server.PmServer.ExecuteAnalyticReportWithParameters(RepositoryLocation analyticReportViewLocation, BIDataContainer biDataContainer)
    PerformancePoint Services error code 20605.
    Thanks in advance for your help.

    Hello,
    I would like you to try the following to adjust your readerquotas.
    Change the values of the parameters listed below to a larger value. We recommend that you double the value and then run the query to check whether the issue is resolved. To do this, follow these steps:
    On the SharePoint 2010 server, open the Web.config file. The file is located in the following folder:
    \Program Files\Microsoft Office Servers\14.0\Web Services\PpsMonitoringServer\
    Locate and change the the below values from 8192 to 16384.
    Open the Client.config file. The file is located in the following folder:
    \Program Files\Microsoft Office Servers\14.0\WebClients\PpsMonitoringServer\
    Locate and change the below values from 8192 to 16384.
    After you have made the changes, restart Internet Information Services (IIS) on the SharePoint 2010 server.
    <readerQuotas
    maxStringContentLength="2147483647"
    maxNameTableCharCount="2147483647"
    maxBytesPerRead="2147483647"
    maxArrayLength="2147483647"
                  maxDepth="2147483647"
    />
    Thanks
    Heidi Tr - MSFT
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • INVENTORY REPORT for customer but not consignment company owned

    HI Everyone,
    I am working on creating an inventory report and sending it out to a customer.
    We have a customer who needs to see their inventory we are going to ship. we are making materials for them on an MTS scenario based on a forecast... So the customer before placing a PO should be able to look at the inventory levels we make for them. on a daily basis.... No what I am trying to is execute a program that sends out an inventory report (the programs I am using are( RSMIPROACT and ROEMPROACT)... I try to fill in the fields and save as a variant and we run it as a background job every morning and we send out an idoc to the customer...
    The above process is a scenario that still needs to be worked on...
    THe customer should be able to look at only his stock and not any other stock....
    Now can we use a display of listing/exclusion function to send out the material stock report.... we need to send the total inv as well as the mat numbers... can we acheive it with the listing/exclusion funtion..
    Or is there a program that pulls all the data from the tables which store the customer material info record where we maintain all the materials for a customer...
    If there i a better way through which this can eb done please suggest me... thank you..
    Once again the above stock is not consignent stock... we are manufacturinng based on the forecasts and we need the customer t be able to look at the stock on a daily basis.... Please help...

    There is no report / funtionality is SAP to acheive this. Custom program is the only solution. Your logic looks ok, where there is a CMIR maintained, you may pick the total stock from table MARD put into a format/layout and transfer via idoc to the customer.
    Thanks & regards
    AHP.

  • Inventory Report For Special Stock (Project Stock)

    Dear Sir,
    We are in Make -To - Order scenario and procure the material against  the WBS element . For getting the Inventory List , we use MBBS tcode but it has following limitation :
      a) It give the Stock Status as on date basis . While we need Stock Inventory on a cut off date , say on
          31/Jan/2007 .
      b) We are not able to get the Inventory Report , Material Group wise
    I request to kindly guide me , as how to take the Inventory Report for Project Stock .
    Regards
    B Mittal

    Hi Shailesh,
    Is there any way we can include some extra fields into this MC.9 report - i tried but could not find anything.  Can you please help.
    Regards,
    Laxmi

  • Inventory report for Previous Periods

    Hi Experts ,
    I would like to have an inventory report for all materials in a Particular Plant for the Periods Sep 2009 and Sep 2010 . Could you please help me in providing the reports for the same .
    Thanks
    Moderator message: Basic frequently asked question - Please search forum for answers and read the docu in help.sap.com 
    See as well our rules of engagement: http://scn.sap.com/docs/DOC-18590
    A good way to search the forum is with google. See this blog with details for a good search
    http://scn.sap.com/community/support/blog/2012/04/16/getting-the-most-out-of-google-optimizing-your-search-queries
    This blog describes how to use the SCN search: http://scn.sap.com/community/about/blog/2012/12/04/how-to-use-scn-search
    The discussions are not a replacement for proper training
    Thread locked
    Message was edited by: Jürgen L

    You can well run these reports on background..
    Go to SE38 Enter the program name "J_1HSTCD"
    Then press Execute / F8.
    Enter you selection date as 01.09.2009 to 31.09.2010 and enter the plant and leave the all selection as per SAP standard..
    Then press F9 or Go to Program

  • Inventory report for the selection of requisitioner and MRP controller

    Hello Experts,
                           Can someone please help me with a standard  Inventory report in which we can give input thr requistioner and MRP controller
    regards,
    YK

    Hi,
    You will get the requisition no. from EKKO (provided PO has been created otherwise you won't get any record). Find out PO & item no. for the requisition item. Then you can check EKBE table whether GR has been posted or not. If GR has not been posted then there won't be entry in EKBE for that PO & item.
    Regards,
    Rakesh

  • Inventory Report-Replacement path for Base UOM to Case and Standrad Cost

    Hi, We have a Scenario as below:
    Question1:
    We have a multiprovider contains 4 infocubes and 2 Master Data objects
    a.Demand
    b.Inventory
    c.Sales Orders
    d.In Transit
    Master Data objects
    a. Material (contains Base UOM to Case as Key Figure Attribute and also Base UOM as an attribute)
    b. Material Location (Contains material as an attribute and also Standard Cost as a Key Figure attribute)
    At the report level two formula variables are defined with replacement path for showing the Base UOM to Case and Standard Cost in columns.
    We have 4 reports on this multiprovider. There is a dialy sales report which gives the following details
    Material, Location, MRP Controller, CalDay, Base UOM, Actual Sales(AS), Dependent Demand(DD), Consumption Qyt(CQ), Base to Case UOM, Standard Cost
    In this report for all the records the Base to UOM and Standard Cost column is coming with values which is nothing but the replacement path on the material master key figure attribute. Though this report is on the multiprovider all the major keyfigures (AS, DD and CQ) are coming from a single cube( this is an observation from myside).
    We have another report which is the Inventory Report with the following details:
    Material, Location, MRP Controllder, Calday, Base UOM,      Unrestricted Inventory(UI), committed Inventory(CI), Back Order Qty(BOQ), In Transit by Sh/Rec(ITS), In Transit Pipeline(ITP), On Order Qty (OOQ), Current Inventory Position (CIP), Quality Inspection Stock(QIS), Block Stock(BS), Base to Case UOM, Standard Cost
    Now in this report for all the records the Base to Case UOM and standrad cost is not showing up. Is there anything which needs to be done in order to get the Base to Case UOM and standard cost for all the records.
    Question2:
    When Non-Cumulative and Cumulative key figures are combined at the multi provider and also at the report level, will there be any problem?
    Regards
    Vijay

    Hi,
    I think you can proceed with virtual characteristics for this.In the code you can truncate the time and you can display on the date:
    Regards
    Prasad

  • Inventory report for stock category B

    Hi everyone,
    We are trying to generate a customer stock inventory report with stock category B. The table MARD is not displaying any values annwe also looked at table MKOL. Its not giving us any. How do i get the inventory report for this stock type B. Kindly Advise.

    it is customer owned stock. We receiver materials from customer for repair and we recondition them and we give it back. for this we maintain it in stock type B. it is specifically used in aerospace industries. We want to make an inventory report for this customer owned stock in our inventory . i am unable to get the table. Kindly advise

  • Report Using Query

    Hi Gurus,
    In Lead Transaction, Details Tab there is field called Campaign, i req. the table name for that field bec. i have to generate the report using Query?

    Hi Milind,
    Create a new Transport Request.
    Now Go to RSA1->Transport  connections, select your query and drag to the Right hand side.
    Now select all the query elements for that query and click on the Truck (Transport button), It will ask you for the transport Request. Provide the Transport Request Number you have just created.
    Once done, just to be sure, check the Transport requests elements in SE09. Check if all the query elements have been included in the report.
    Now you will be able to modify the query in Query designer. If still not able to, then you must missed some of the query elements. Again check this in Transport Connection.
    Regards,
    Pratap Sone

  • Inventory report with the last transaction details of each material

    Hi,
    is there any standard inventory report in SAP which gives us  the last transaction details of each
    Material,along with last procurement qty, value, date and last issue
    details of Qty, Value & date.
    Thansk in advance.

    Hi
    try following t-code
    MB5B u2013 Stock on Posting Date
    or
    2   s_p00_07000139 u2013 Stock Card and Inventory Material Report
    Regards
    Kailas Ugale

  • Difference: SAP BW Report iview - Query iView - URL iView

    Hi,
    I want to show BW reports on the portal. Can anybody suggest me the different ways of doing it ? And also let me know about checklist of steps that need to be performed.
    Can anybody tell me the difference between showing BW reports through URL iviews, showing reports through Query iView and showing reports through SAP BW Report iView ?
    Which one can i use for showing BW reports taking into consideration the implementation of SSO between the two? I tried the URL iView (using the Web URL of reports generated by BW) but it asks for Username/password. Is that the problem with SSO. How can i check if SSO parameters have been set or not. I have imported the verify.der to BW System and added that to ACL. Is there anything else which is required?
    Thanks in advance.
    Rgds,
    MA

    Hi Manoj,
    I feel BW report iview will solve your problem. You can create a query sting in BW query designer and give the same in BW query  string text area while creating BW report iview.
    In the case of an url iview you are just giving a URL link of the BW report (this will ask for username/password).
    But, in the case of a BW report iview you can view the required query as an iview (user mapping can be successfully done in this case) You should give fully qualified domain name in Was server option while creating the system.
    While using the logon ticket Login id of both the system (ie BW and Portal) should be the same.
    Refer the link for SSO using logon ticket)
    User Mapping-based Single Sign On
    Regards,
    Vinod

  • Error while executing report in query designer

    Dear Folks,
    I am geting following error while executing report in query designer.
    Error:500 E
    an exception raised because of 0analysis pattern.
    Hence,i am unable to execute any report.
    Need help.
    Thanks

    Hi Kitu G,
    I think this is something to do with the bex web 0ANALYSIS* objects not being installed in your BW system.
    I would try and do the following:
    - Goto RSA1 > BI Content > BEx Web Template (BTMP)
    - Then double-click on Select Object.
    - Highlight all objects that start with 0ANALYSIS_PATTERN
    - Click on Transfer Selections, and then Install.
    If you can't do the above in prd, do it in DEV, then transport the objects to prd.
    After all this, try re-running your queries.
    Any questions/clarification just let me know
    Cheers.
    Darwin

Maybe you are looking for