Sales report from query generator

Hi Experts,
Im using query generator i had given selection criteria like, Posting date from and To, Profit centre, Numbering series name,
query:
SELECT T0.[DocNum], T0.[VatSum], T0.[DocTotal], T1.[PrcCode], T1.[PrcName], T1.[Balance] FROM OINV T0 , OPRC T1 INNER JOIN NNM1 T2 ON T0.Series = T2.Series WHERE T0.[DocDate] > ='[%0]' AND  T0.[DocDate] < ='[%1]' AND T1.[PrcCode] ='[%2]', T2.[SeriesName] ='[%3]'
Error:
1.     1)(Microsoft)SQL Native client)(SQL Server)Incorrect syntax error near u2018 u2018,Microsoft(SQL Native client) (SQL Server)statement u2018User Defined Valuesu2019 (CSHS)(1) could not be prepared.
can u give any idea to solve this problem,
thanks in advance,
anand.r

Hi,
I made a mistake in the variables:
SELECT     T0.DocNum, T0.VatSum, T0.DocTotal, T1.PrcCode, T1.PrcName, T1.Balance
FROM         dbo.OPRC AS T1 INNER JOIN
                      dbo.OINV AS T0 INNER JOIN
                      dbo.NNM1 AS T2 ON T0.Series = T2.Series ON T1.PrcCode = T0.Project
WHERE     (CAST(T0.DocDate AS VarChar) <= [%1]) AND (T1.PrcCode = [%2]) AND (T2.SeriesName = [%3]) AND (CAST(T0.DocDate AS VarChar) >= [%0])
Kind regards,
Hendri Wessels
EDIT: I see that the variables do work in B1UP like this, but not in SAP Query generator.
Edited by: Hendri Wessels on Jul 27, 2009 8:58 AM

Similar Messages

  • Creating sales report from AR Data

    Hello,
    I'm Willie Owens. The company that I work for is currently in the process of implementing Oracle 11i applications. However, I have recently learned that when we first go-live with our system, we won't have the business intelligence system up. Therefore, I am going to have to create most of the views used for our sales reports from "scratch". Has anyone every used the RA_Customer_TRX_All and RA_Customer_TRX_Lines_All tables under the AR schema to accurately reflect sales information? If so, I could appreciate any input or suggestions that are offered.
    Thanks,
    Willie

    Hello Mark,
    Perhaps I should begin by describing some of the reports. One of the reports shows the sales by salesrep. These are the fields that are going to be used:sales amount, percent of sales, cost of sales, profit, percent of profit, and margin percent.
    I have some ideas but I'm just not certain. For the For example, to compute the sales amount would I use the UNIT_SELLING_PRICE * QUANTITY_INVOICED or UNIT_SELLING_PRICE * QUANTITY_ORDERED?
    Also, to calculate the cost of sales, do I use the UNIT_STANDARD_PRICE * QUANTITY_INVOICED(or QUANTITY_ORDERED)?
    I understand that my profit would be the difference between these two previously calculated amounts. I also need the user to be able to enter a period ending date value. The Discoverer report should then capture all of the sales up to this entered date.
    Then to further complicate things, I have to be able to calculate all of these values for the Period To Date(which means that it will capture all of the sales info from the 1ST day of the current month up until the Period Ending Date);a Year To Date Line will also show these values from January 1st of the current year up until the Period Ending Date.

  • How to generate Top sales report from SAP data ?

    Hello experts,
    I am completely a newbie to SAP BO , can any one guide me how to generate TOP sales of the year report from SAP data ?

    Hi David,
    First Let me know the Source & Tools to involve.
    Let me go with the generic approach:
    If the source is BW, then you can create the logic in query designer designer and then you can incorporate the data into the dashboard or webi or crystal report whatever its.
    If the source is sql or anyother DB then it can also be achievable in crystal or webi to write the logic in top 10 values by ranking then you can incorporate the data into the dashboard, but here you can limit the top or bottom values.
    Hope this helps, please revert for more clarifications on this.
    --SumanT

  • Error while executing report from Query designer

    Hi All,
    When I am executing from query designer, I am getting following error.
    Even I can't execute it from another portal where i created source system of BI server.
    But i can execute queriew from Query analyser and t-code RSRT.
    When I execute from Query desinger the url is as follows.
    http://XXX:00/irj/servlet/prt/portal/prtroot/pcd!3aportalcontent!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=0PA_C01_Q0201&VARIABLE_SCREEN=X&DUMMY=5_
    And the error is:
    500 Internal Server Error
      BEx Web Application
    Failed to process request; contact your system administrator
    Information for Administrator
    To avoid this exception see the steps below. To help SAP better investigate this issue, you will need to provide the diagnostic information from these steps.
    1. Most likely, the issue you are experiencing has already been corrected. Please make sure that the most recent patch level is deployed on your system according to notes 1033246 and 1011241. Starting with Support Package Stack 16 patch level 30, BI Java is delivered according to the synchronized delivery process described in the note 1033246.
    2. Please ensure that NetWeaver Business Intelligence Diagnostics & Support Desktop Tool  does not report any issues on your server according to note 937697. You can start it by clicking here (administrator permissions are required).
    3. When opening any customer message on this issue, please attach:
    Support Desktop Tool support info ZIP  file according to note 937697,*
    Required information for reproduction  according to note 948490.*
    Error Summary
    Exception occured while processing the current request; this exception cannot be handled by the application or framework
    If the information on this page does not help you locate and correct the cause of the problem, contact your system administrator
    To facilitate analysis of the problem, keep a copy of this error page Hint: Most Web browsers allow you to select all content, and copy and paste it into an empty document (such as in an email or simple text file)
    Root Cause
    The initial exception that caused the request to fail was:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at com.sap.ip.bi.webapplications.runtime.service.metadata.impl.MetadataAccess.getMetadataModel(MetadataAccess.java:139)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.getMetadataModel(Page.java:8953)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.normalizeCommands(Page.java:4963)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:4473)
    at com.sap.ip.bi.webapplications.runtime.impl.Page._processRequest(Page.java:3316)
    Details: Full Exception Chain
    System Environment
    Server
    BI Java Release: 7 - Patch level: 0000000100 - Description: BI Web Applications Java - Additional info:  - Production mode: true
    BI ABAP unknown
    Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM - Sun Microsystems Inc. - 1.4.2_24-b04
    Operating System SunOS - amd64 - 5.10
    REgards
    Mohan

    Hi mohan ,
      You can check these OSS notes for the issue  .
    1. 795699 - Customizing default error messages for HTTP
    2. 807000 - Http requests are not fully read after timeout
    3. 804124 - HTTP communication with XI Adapter Engine fails
    Regards,
    Lokesh

  • Std profit center report to campare daily sales report from BW

    Hi
    daily sales report (filtred throgh BW using Profit cneters and account groups) need to compare
    with sap  R/3 DATA . kindly update me where i will extract it ( like any s_alr_87..... reports in profit center ?)
    let me clarify my query:
    daily sales report is getting on the basis of profit centers through BW (revenue element and profit center wise)
    where could we compare it with R/3
    thanks in advance
    Edited by: barnabasjh on Jul 1, 2010 7:23 PM

    You can use following:
    1. KE5Z (profit center actual line item report)
    2. S_ALR_87009712 (profit center actual/plan report)
    3. KE5Y (profit center plan line item report)
    Thanks.
    Rahul

  • FRM-41219 - Cannot able to call reports from form generated in Designer

    Hi
    I'm trying to call a report from form whit a button generated in Designer 10.1.2.0.2
    But I'm getting error : FRM-41219 Invalid report id
    I'm tying with a menu but I'm getting the same error.
    Please help me

    Note 1056653.6
    FRM-41219 Cannot Find Report: Invalid ID
    Problem Description:
    You are getting error: FRM-41219 Cannot Find Report: Invalid ID
    Problem Explanation:
    The code is using find_report_object and passing a report name to the function.
    The statements are as follows:
    DECLARE
    repid REPORT_OBJECT;
    BEGIN
    repid := FIND_REPORT_OBJECT('report1');
    END;
    Solution Explanation:
    The error message frm-41219 is a new error code which corresponds to the
    Oracle Developer forms/report integration.
    This message essentially means that the report cannot be found. Specifying the
    correct name of a report object found in the forms object navigator (not the
    actual name of the rdf file) usually resolves the problem.

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • Create a report from query

    Hi,
    I've just built a query using the $[user] internal SAP parameter, to retrieve the UserID doing the request and to manage different results.
    Everything works fine since we use the query interactively.
    I've also built a report (PLD) related to this query.
    With great surprise I've found that the $[user] parameter doesn't work on PLD. In fact I throw a "system internal error" launching the report.
    If I discard the statement using the $[user],  everything works.
    Any suggestion?
    SBO2007A PL09
    Antonio

    Hi
    The QPLD (Query Print Layout Designer) may present issue if you remove a original field from the query that was based the Layout.
    Even some fields added manually (depending on each case) may not work or not.
    In this case what I can recommend is get the query and create a new QPLD (removing the
    $user
    ) in order to avoid the error.
    That is the way to fix it.
    Paulo Calado
    SAP Business One Forums Team

  • Execute report from query designer

    Hi Folk,
    I have created an query in bex queri designer.
    Now I want to see the result and I push the execute button.
    But insteed of an report I get the famous empty webpage
    "Internet Explorer cannot display the webpage".
    the URL is as follow.
    http://compi.compi:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=ZSALES&VARIABLE_SCREEN=X&DUMMY=5
    Do I have to setup something?
    Many thanks for your help.
    Rg. Jimbob

    Thanks,
    I tried both, menu and button but the same result.
    Unfortunatly, I have no Basis to ask.
    Also then I try to start the query from RSRT on button 'ABAP WEB', it asks me for user and passwort.
    Then I give user like J2EE-ADMIN or the SAP* and passwort it tells me to check SSO ticket.
    But I can not find a doku how to do that.
    Any other Ideas?
    Rg. Jimbob

  • Stopping Reports from Being Generated

    When I first tried Network Magic I set up the reporting function. Essentials which I finally purchased does not have the reporting function but my computer is still trying to send reports. How do I turn that function off.

    I am fairly new at this so let me try my best to answer these questions:
    Crystal Reports  XI
    Visual Studio? Not sure
    No service pack applied. How and where do i get it?
    I am using Windows XP
    I am not viewing the reports as it has to be generated before i am able to view and the systems does nothing after I click the generate button
    No  have not tried to view a single report; i don't know how.
    I have not used Crystal reports designer for anything else.
    Edited by: Sharon Aird on Dec 1, 2008 5:05 PM

  • Adding update and delete buttons to a  Report from SQL Query

    There is an option when creating a QBE to add update and delete
    links which i find quite useful, but this option doesn't seem to
    be possible on a Report from SQL Query. Do i need to do
    something special to add them? is the option located in a
    different place?

    Hi,
    You can only add Update ,Delete in QBE Reports,
    there is no option in Portal which can be used to
    have these buttons in the Reports from Query Wizard or
    Report from SQL Query.
    Thanks
    Vineet

  • Could anybody give me the logic in sales report

    Hi All,
    I have a sales report on multprovider. In this sales report, I want to find out how many customers had done the transactions in day.
    <b>Two transactions for one customer in a day can be counted as one transaction</b>.
    Could anybody give me the logic to how to find the total number of customers made transaction in a day.
    Thanks in advance
    Narendra

    Hi Anil,
    Thanks alot for your answer.
    I am not sure, how the user is going to excute the report.however there is a <b>user entry Characterstic variable on 0CALDAY with selection options.</b>
    For example :
    If the user run the sales report  from Calander Day from 01-06-2007 to 06.06.2007.
    that means 4 business days (1st, 4th, 5th and 6th June). He wants to see the total number of customer done the transaction in a day separately, means 1st June how many customers, 4th June how many customers, 5th June how many customers, and 6th June how many customers.
    Based on the user selections,how many customers per day made the transactions. could you please send me the logic.
    My email Id is : [email protected]
    <b>Note : Query <---- multiprovider <---- Infocube <---- ODS</b>
    Thanks in advance
    Narendra

  • Query generator used to make general total and row total

    Dear experts/gurus,
    I have a problem how to create general total and total field in row by using query generator. In inventory in warehouse report of SBO 2004A SP 00 PL 41, there are total row of price x quantity / warehouse (if selection criteria is warehouse) and general total. I have made query report that quite similar with inventory in warehouse report using query generator and put selection criteria and item but I still can't find out the solution. is it possible using query generator to do that or if I use query analyzer, what is the code that I have to put ? is it compute sum(qty x price) by itemcode or there is stil another ? i appreciate your answer. TIA
    Rgds,

    Hi Jimmy,
    Here's one approach to solve your problem:
    = = = = = = =
    select oitm.itemcode, oitm.itemname, whs.whscode, whs.quantity
    from oitm inner join
    (select itemcode, sum(onhand) as quantity, whscode from oitw group by itemcode, whscode) whs
    on oitm.itemcode=whs.itemcode
    = = = = = = =
    ...the main query refers to the subquery as it was another table. The subquery calculates quantity per warehouse from the oitw table.
    Of course you could create a view in SQL Server instead of a subquery. That would make the query inside B1 query generator more simple and would also make it faster to execute.
    Henry

  • Designing simple sales report

    I am trying to create a Sales report from two tables: PRODUCT table and ORDER DETAILS table.
    The Order Details table has the following fields: Order ID, Product ID, Unit Price and Quantity. The Order ID field is a primary key in another table called ORDERS.
    The columns I want in my report are: Product code, Unit Price, Quantity Shipped and Sales. Product code and Unit Price are fields in the Product table and I can show them easily in my report. The problem I am having is displaying the Quantity Shipped and Sales columns. I have created two formulas to calculate this information.
    Quantity Shipped formula:      Sum ({Orders_Detail.Quantity},{Product.Product ID} )
    Sales formula:     {Product.Price (SRP)} * (Sum ({Orders_Detail.Quantity},{Product.Product ID} ))
    These formulas seem to work well. The problem is that when I place them in my report, I get three rows for every product id. So I end up with three rows of the same information for every product in my report.
    I am practicing with the xtreme.mdb that I downloaded from this website. Any help that you can provide would be much appreciated.

    HI,
    Thanks for the info.
    Placing the information in the group header solved the problem of having rows appear multiple times. Now each product item appears only once.
    HOwever, I am still unable to figure out how to show the quantity shipped for each item. I guess I will have to use the Quantity field in the Order_Details table. Doing a running total on this field in the group header just does a running total on the quantity field without being tied to specific product.
    Your help is much appreciated.

  • A/R Sales Report Dynamic Selections Have No Impact. RFDUML00 S_ALR_87012186

    When selecting specific G/L account in A/R sales report from the dynamic selections list, the results are not considering the restriction.  Report is program RFDUML00 and tcode is S_ALR_87012186.
    Is there some configuration required to make this dynamic selection recognized by the report or??

    Hi Grevaz,
    I would check tomorrow and then see.
    Thanks for the reply.
    It hard to trace whats the error ans you are the first to reply back after 1 and half day
    Cheers
    Ajay

Maybe you are looking for