Query Manager Report.

Hi,
I'll start off with im rubbish with this query writer and not asking for much (I don't think).
I want to be able to run a report that shows me
Between Dates
U_SORT01 (A UDF I have)
Invoice DocNum
Invoice DocTotal
Credit DocNum
Credit DocTotal
I then would like to show Invoice Doc total - Credits by U_SORT01.
The reports I keep building shows me  some false lines.
So far I can build the 2 reports on their own please see below
Invoice
SELECT  T0.[U_SORT01], SUM(T1.[DocTotal]) AS Invoice
FROM OCRD T0  INNER JOIN OINV T1 ON T0.CardCode = T1.CardCode WHERE T1.[DocDate] between '[%0]' and '[%1]' and T1.[DocStatus] = 'o'
GROUP BY T0.[U_SORT01]
Credit report
SELECT T0.[U_SORT01], SUM(T1.[DocTotal]) AS Credit
FROM OCRD T0  INNER JOIN ORIN T1 ON T0.CardCode = T1.CardCode WHERE T1.[DocDate] between '[%0]' and '[%1]' and T1.[DocStatus] = 'o'
GROUP BY T0.[U_SORT01]
All i need to do now is get the credits to minus from the invoice but making sure that they minus from the correct place.
EG
SORT 001 invoice needs to have SORT 001 Credits minused.
Any help would be appreciated.
Thanks
Joe

Hi Joe.....
Modify the below query as it contains both Invoice and its Credit quantity.......
You have to just make a difference calculation.....
SELECT T0.[DocNum], T0.[DocDate], T0.NumAtCard As 'Bill No.', T0.[CardName], T1.[Dscription], T1.[Quantity], T1.Price As 'Rate', T1.[LineTotal] As 'Value', T0.[DocTotal] As 'Total Value', (ISNULL((SELECT SUM(T2.QUANTITY) FROM rin1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetQTY, (ISNULL((SELECT SUM(T2.LineTotal) FROM rin1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetValue, (isnull((SELECT SUM((case when upper(t4.STACode) like 'BED%' then T4.TaxSum else 0 end))
      FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ExciseDuty,
     (isnull((SELECT SUM((case when upper(t4.STACode) like 'eCess%' then T4.TaxSum else 0 end))
      FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ECess,
     (isnull((SELECT SUM((case when upper(t4.STACode) like 'hes%' then T4.TaxSum else 0 end))
      FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) HEdCess, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'VAT12.5',
(isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT4, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT2, (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST2',
(isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
FROM INV4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST4', T2.TransCat As 'Form No.'  FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN INV12 T2 ON T0.DocEntry = T2.DocEntry WHERE (T0.[DocDate]>='[%0]' and T0.[DocDate]<='[%1]')
This is an example hope this will help you......
Regards,
Rahul

Similar Messages

  • Query Manager/Report Design

    Is there some documentation on how to create reports from the query manager.
    I have tried looking at the Print layout designer in the elearning section but it does not cover the query manager (and does not cover the whole product anyway), so I am looking for information on how to do this
    I have a query but I want it put in a page break after each category.
    so.. any doco help files ,DETAILED webexes would be very useful. as the resources that should be available are too well hidden!!

    Hi george,
    There is many documents but i don't think there is one that is specificaly on reprts based on a query. Can try e-learning.
    But what you want to do is simple. Open the queries manager. highlight your query. then click create report. Save it. Then go to the top to tools->queries->query print layout.... once you're then you can edit it. You must then right click RIGHT ON THE EDGE OF THE REPETITIVE AREA. Then a window comes up with repetitive area that then leads to sort. there you can say what to summarise by and when to break the page.
    Hope this helps.

  • Query manager report deleted

    Hi Experts,
    We are using "SAP Business One 2005 SP01". An user has deleted a report in the Query Manager. How can we detect who is the user?.

    There is no log for this and therefore it might not be possible to trace who did this.
    Please manage these using Authorizations to avoid them in the future.
    If you have a recent backup of your database, you should find the query there.

  • How to add drop down list for query manager report in sap business one

    Hi Every one,
    I need drop down list for parameter selection in sap business one Query Manager.I have two Parameters 'Sales Order','Invoice'.
    Please suggest.
    Thanks and Regards
    DEV

    Hi,
    you need to use this :
    /*select from [dbo].[OINV] T2*/
    DECLARE @Invoice varchar(100)
    /*where*/
    set @Invoice =/* T2.DocNum  */N'[%2]'
    you can change the tables and the parameter number but you have to write it exactly that way.
    when you run the query within the SBO you will get list of objects ( in this case list of invoices)
    hope it was helpful
    Shachar

  • How to create report from SDK without clicking through ther Query manager ?

    Hello,
      I need to create an on-screen report with selection criteria. (Something similar to Reports/Inventory/Items list)
    I could create a query and save it but
    - how to start the query by SDK then - without clicking through the Query manager ?
    - how to pass the selection criteria to the query ?
    Please suggest me ?
    Regards,

    As the helpcenter(2005 helpcenter) has missed this bit of documentation (on UserQueries) could someone please provide an example of using this object
    thanks
    Message was edited by: George Savery
    hmm I thought it had timed out .... Woops

  • How to define the PLD of a Query generator report

    Hi All,
    I want to define the PLD of a Query Report. Currently I am Convertning it to Excel format. But my client wants it in PLD format.  so please tell me the process of defining the PLD for a Query generator Report.
    Thanks & Regards
    Pankaj Sharma.

    Hi,
    When u wrote yr query at that time save yr query
    Now yr query is save in "Query Manager"
    Open Query Manager > select yr query
    There is a button "Create Report"
    Create USer Report Window is display "define yr name" and select "Base Temple"
    once u save it double click and edit yr PLD....
    Hope it a best way to create uer PLD
    Thanks
    Kevin

  • Unable to create new query using query manager

    Hi friends,
    I have been trying to create a query using query manager for couple of hours but still not able to.I am following the instructions given in oracle Peopletools 8.52 : Peoplesoft query
    Chapter - creating new queries.
    Below are the steps I am going through to create new query:
    Step - I open the component Reporting Tools-> Query->Query Manager , I don't get the tabbed pages one for search an existing query and another for create new query.
    Please follow this link to see how the page is displayed in first step:
    http://uploadpic.org/v.php?img=EvMvVAXX1E
    Step 2 - When I click on create new query link, I am redirected to a page where it asks for record name to add in the query. But, even this page is not displayed as how it supposed to be
    http://uploadpic.org/v.php?img=GzHh3f6krU
    Step 3 - Following the above step, when I click on Person record to add into my query I am asked to select the fields that I want to display in the output.
    But I somehow do not get the proper tabbed pages where individual pages are there to add the attributes to complete the query like adding multiple records, fields, query, expressions, prompt...etc
    http://uploadpic.org/v.php?img=Wbbla3Q3jE
    I am neither able to select multiple records in my query nor able to customize my query to get the desired results.
    Below is the query that I want to create using query manager:
    SELECT P.EMPLID,P.BIRTHDATE, N.NAME, A.ADDRESS1, A.ADDRESS2, A.CITY
    FROM PS_PERSON P, PS_NAMES N, PS_ADDRESSES A
    WHERE P.EMPLID = N.EMPLID AND
    N.EMPLID = A.EMPLID AND
    P.BIRTHDATE BETWEEN to_date('1990/1/1','yyyy/mm/dd') and to_date('1991/1/1','yyyy/mm/dd');

    Hi,
    As I cannot access your screenshot by the blocking of company firewall rules.
    I'm guessing currently you are using PT 8.52.00 version, correct?
    This should be a bug, that you need to apply the 8.52.0X patch, not sure which patch fix this, you can apply the latest one to solve this issue for no tab page of query manager. (PT 8.52.06)
    Hope this helps.
    Thanks,
    Saxon SI

  • Sql query in report/source

    Is possible use this kind of select select a,(select b from b) from b
    in sql query in report/source?

    Pretty much any valid select statement can be used.
    If it works in SQL*Plus, then it should work in Application Express.
    I think your example would not be valid if table b has more than one row.
    A scalar subquery (like your "select b from b") must only return a single value.
    SQL>  select ename, (select job from emp) from emp e;
    ORA-01427: single-row subquery returns more than one rowIf your subquery can be restricted to return one value, then it should work.
    SQL>  select ename, (select job from emp where empno = e.empno) job from emp e;
    ENAME      JOB
    KING       PRESIDENT
    BLAKE      MANAGER
    CLARK      MANAGER
    JONES      MANAGER
    SCOTT      ANALYST
    FORD       ANALYST
    SMITH      CLERK
    ALLEN      SALESMAN
    WARD       SALESMAN
    MARTIN     SALESMAN
    TURNER     SALESMAN
    ADAMS      CLERK
    JAMES      CLERK
    MILLER     CLERK
    14 rows selectedBut is that the kind of result you were looking for?

  • Oracle Reports - Distributing Multiple Reports in a Management Report

    Hi,
    I am new to Oracle Reports and would sincerely appreciate some guidance.
    Requirement.
    I plan on using Oracle Reports to write multiple reports containing Text, Graphs, Crosstabs, Tables etc. There are 3 developers and each will be developing a number of reports.
    At the end of each month, we need to run all the reports and publish it into a Management Report Pack.
    This Management Report Pack must contain a table of contents with the names of the different reports and page numbers. Each Report in the Report pack needs to have a header, footer and page number.
    The number of reports will change on a monthly basis so the page numbering will not be specific to a report.
    Summary,
    3 developers writing multiple reports
    All reports must be run and then printed out in a specific order.
    Table of Contents page with page numbering for each report.
    How can we do this with Oracle Reports?
    Is it possible, and if so, how?
    What is involved and what is required?
    Your assistance is highly appreciated.
    Thank you.

    You should be creating a universe using the table with filter utilizing a column which accepts a parameter value of language and shows the data in that specific language. This concept is already used in SAP standard audit universe which accepts language for any query and shows the data in that language.. The logic for the derived column for the table should look something like below Table.LANGUAGE = @Prompt(Select language)

  • Not able to save / update SQL Query in Query manager

    Hi,
    I am using SBO 2005 B PL 25, facing unique problem in Query Manager.
    There are various queries saved in Query manager, tried updating & creating  / saving new query but not able to do so.
    System displays messaged as operation completed successfully, but the query is not updated.
    Kindly let me know is there any setting which blocks the updation.
    Regards,
    Yogesh Jadav
    Edited by: YOGESH JADAV on Aug 11, 2008 3:07 PM

    Hi
    You cannot Modify or Update query in the 'System' Category.
    If you are trying to create/ modify/ update query in some other category, check for the authorizations in
    'Administration -> System Initialization -> Authorizations Window' -> Reports ->Query Generator'.
    Check if you have authorizations for the following
    New Queries
    Create/Edit Categories
    Saved Queries - Group No. 1
    Saved Queries - Group No. 20

  • QUERY MANAGER RELATED QUESTION

    mY QUESTIONIS I WANT TO ADD CALANDER AS INPUT PARAMETER IN QUERY MANAGER IS THIS POSSIBLE AND IF THAN HOW?
    PLEASE HELP ME OUT
    THANKS IN ADVANCE
    TARUN CHAUHAN

    Hi nagarajan,
    Let me elaborate my question one again.
    1)i had taken two date parameter in my query in query manager.on manul filling up those date parameter my query give the result which i am fetching from my data base.
    But instead of manual entry of date in above two parameter i want that i should give calendar button so that user can opt the date from that calendar, as in the same manner as we are doing in inventory posting list report .for your reference i am attaching the screen shot.
    Please help.
    Thanks
    Tarun Chauhan

  • Query Manager Condition Problem

    Dear expert,
    In B1 query manager, i found a report called 'Production Order Report' and there is a searching condition which i don't understand.
    Code:
    T3.CardName= '[%9]' or '[%9]' = ''
    If user dose not input this parameter, how the query manager  handle the query??

    Hi Kit,
    The query code you mentioned basically says that if the [%9] variable is blank, don't filter on it, else filter on it. You can test it with this query
    declare @Code varchar(15)
    set @Code= ''
    --set @Code = 'C1000'
    select * from ocrd where (Cardcode= @Code or @Code = '')
    If you run it as is, all records in OCRD will be returned, if you run it with the commented line uncommented it will return only C1000.
    Hope it helps,
    Adele
    <i>PS: I have seen that every post you make you set as answered/solved problem already. Please make sure which problems are solved and which not. People tend to not look at solved posts that often. Every question you asked have been marked as solved before anyone replied. Were they solved?</i>

  • Query Manager- Filter List Missing Values in the Filter List.

    Hello experts,
    We would like your help in the following issue.
    We are using SAP B1 9.0 (PL10).
    When we run a query report from the query manager in SAPB1, the report results that are displayed contain an extended list of names, starting from A to Z. When we use the filters button in this report, in the filter field with the BP Names the list contains only the names from A to M, and not the rest.
    Please advise us, if anyone has faced the same issue.
    Thank you in advance,
    Vassilios Korolis.

    Hi,
    Please check SAP note:
    1012827 - Filter table function displays only up to 499
    values
    Thanks & Regards,
    Nagarajan

  • Print Preview for Query Manager

    Hi all
    When I open up query manager and run a report query it opens up the correct information however when I click on print preview it brings up a window which says print preferences and has a selection of window, table, or selection area.  I want the selection to be table permanently.
    What I want to know is what do I need to do to skip past that window and take me directly to print preview in the table format?

    There is no option available to skip the print preferences window or to make the selection to be permanent.
    As an alternate, Export the result to Excel and print from there or
    Create a Query Print Layout for the Query by clicking 'Create Report' button in the 'Query Manager' window, and print the Query Print Layout by selecting  Tools -> Queries -> Query Print Layout

  • Query manager View issue in PIA

    Hi,
    When i navigate through reporting tools,Query,querymanager i am not able to see options
    like records,query,expressions,prompts.Fields,Criteria,Having,Viewsql,Run in Query manager window.
    When i go to the Application designer and tried to run Querys it was working fine.
    DO i need to any thing to see options in query manager window of PIA.
    Please help in fixing the issue.

    See if you user has a permission list that gives access to the QUERY_MANAGER menu and its related components and the Pages page.

Maybe you are looking for

  • How to display sinlge character in o/p column(matnr) in Alv

    Alvreport: material no in output is displaying  Matnr                                                 sdmo46dm0012 from the above i want to display only fifth character in o/p:                                                                          

  • Organisational Unit Structure Search

    Hello, As used in transaction PPOSE and PPO1. I would like to add this structure tree search to an ABAP WD View fields. The transaction used the function module RH_OBJID_REQUEST. Can anyone tell me how this can be done? Alternately is there another s

  • Grid control with combo cell

    Does Anybody have some information about grid control/oracleSpreadTable with combo list instead of text cell. Please help!! null

  • My Big failure to install maverick in Macbook Pro with retina

    Please I NEED HELP i bought macbook pro with retina display i tried to install mavericks but i failed at fortunately i formatted the ssd HELP ME TO INSTALL MAVERICKS.

  • Error after SPS upgrade from SP10 to SP12

    Hi Friends, Recently we have done SOLMAN 7.1 sp upgrade from sp10 to sp12. Now I want to perform configuration activities in SOLMAN_SETUP. But when I am trying to do SYSTEM PREPARATION, I am facing error in first step(Maintain Users). "Error: Number