A query based report

hi experts,
i want to generate a query based report t for following
PoNo     Item No     Qty     Vendor Chal No     Challan Date     Assesable Value     BED Value     SED Value     AED Val     ECS value     NCCD VAL     NCCD Rate     ECS Rate %     BED %     AED %     SED %     Sales Tax     Inv amt     VAT amt     Currency     Form-Series No     Form 31 No     Inv.No.     Inv.Date     Veh No     Packages     PackUnit
these are the columns & fields in diff tables how can i join these tables & get data  pls help me for that how can i achieve this give me query for this.
warm regards
ketan
SAP-B1.
Edited by: ketan pande on Aug 17, 2009 9:41 AM

Hi
If you need the Purchase Order and A/P Invoice Header & Row(Item) Level (Purchase Register)Query Report.
Try this,
SELECT  T0.DocNum as 'PO. No.',
T0.DocDate as 'PO. Date',
M.DocNum as 'A/P Invoice No.',
M.DocDate as 'Inv. Date',
M.CardName as 'Vendor Name',
M.NumAtCard as 'Bill No. & Date',
ISNULL(L.ItemCode,'Service Item') as 'Item Code',
L.Dscription,
L.Quantity,
(Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
(Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
M.WTSum AS 'TDS (Rs.)',
M.DocTotal as 'Total (Rs.)'
FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OPDN T2 ON T2.DocEntry = T1.TrgetEntry
INNER JOIN PDN1 T3 on T3.DocEntry = T2.Docentry
INNER JOIN OPCH M ON M.DocEntry = T3.TrgetEntry
LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
WHERE M.DocDate >= '[%0]' AND M.DocDate <= '[%1]'
GROUP BY
T0.DocNum,T0.DocDate,M.DocNum,M.DocDate,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
ORDER BY
T0.DocNum,T0.DocDate,M.DocNum,M.DocDate,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
Regards,
Madhan.

Similar Messages

  • Setting current values in Multiple Select List in SQL Query based Report

    Hi,
    I have a report based on a sql query that contains a multiple select list. Unfortunately I cannot get the multiple select list to display the current values (p_value) correctly. I have created a page item, :p311_current_versions, that is set using a pre-header process and it returns a value with a colon delimited format e.g. '10.1.2.1.0:10.1.2.2.0'. Then this item is used in the sql query to set the current value (p_value) of the apex_item.select_list_from_query function. However when the table is displayed, instead of having two entries, 10.1.2.1.0 and 10.1.2.2.0 selected, it has an extra entry '10.1.2.1.0:10.1.2.2.0' selected.
    Here is my code:
    select distinct a.product, a.version from (
    select distinct
    apex_item.display_and_save(2,product)||apex_item.hidden(1,env_product_id) PRODUCT,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(3,decode(product, 'HTTP Server' , :p311_current_versions, version), 'SELECT distinct version d, version r FROM ebs_tech_stack where
    product ='''||PRODUCT||'''',
    decode(PRODUCT, 'HTTP Server' ,'multiple="multiple" style="width:170px"','style="width:170px"'),
    'NO') as version
    from ebs_environment_tech_stack
    where environment_id = :p311_umgebung_id) a order by a.product
    If anyone can help me figure out how to set the current values correctly I'd be really grateful!!
    Thanks in advance,
    Jean

    Jean,
    I don't think this is possible using the apex_item package. The select_list_from_query function accepts only a single value for the second parameter.
    Scott

  • Query based report - Edit button

    I am new to APEX and wondered if you could offer some help
    I have a report and form based upon a SQL Query. The SQL Query fetches ids from a cross reference table, along with the display names for those ids from the other relevant tables.
    Now, I am assuming it is because of the query that I do not get an Edit link on the report. Do you know if there is an easy way to establish one?
    Regards
    Karen

    Karen,
    If you used the wizard, the edit-button is a (probably the first) column in your report. Bij clicking on it you get the details of the record after the icon you clicked (hope I'm clear).
    (The computer must know which record you want to edit.)
    If not, go to the report definition tab, look after the attribute indicating the id of your records, and see whether there are links for this attribute.
    Leo

  • Query based Report (Reports From SQL Query)

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    Can i increase a timeout of portal page, how i can do this?
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    Can you post the URL that is giving you the page not found error ? I am not sure if I can be of much help though.
    In order to increase your chances to get a reply you should also post your question in the Portal Forum - Oracle Application Server Portal
    Edited by: Rodolfo Ferrari on Jun 16, 2009 3:49 PM

  • SInstance=Param not working for sap bw query based reports (FWM 02020)

    Has anyone else tried linking to instances using sInstance=Param from a webi to webi or webi to crystal document?
    We have attempted the following using the build hyperlink function in webi.
    1. Select the crystal report.
    2. We have 2 variables, the variables do not have the description coming over from SAP.
    Variables come over as
    !V000001
    !V000003
    3. Select Link to Document instance - Most recent - matching prompt values
    4. Select the values for the prompts with a constant.
    5. Go to the history of the crystal report and look at the selected parameters of the crystal report.
    6. Highlight , copy and paste these into the prompts on the hyperlink
    7. Save and run.
    8.  Receive an error
    An error has occurred: The object with ID -1 does not exist in the CMS or you don't have the right to access it (FWM 02020) 
    We have tried a number of combinations of parameter responses from technical name, description, combination of the two, and so on.  Nothing has worked.
    Anyone else experience this problem?

    Hi Stratos,
    We've created 2 new crystal reports based of sap queries.
    Report 1, single prompt, no hierarchy.
    Result : Can link to specific instance with matching parameters.  Great!
    Report 2, single prompt, hierarchy based.
    Result: Cannot link to specific instance with matching parameters
    Parameter list for report 2
      [!V000001} : Cost Center/Gr{oup (Multiple)  = {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    However when I go into the history and look at the successful instance parameters used, it seems to be picking up an extra parameter ( my guess is node)
    XXX, XXX & XXX; {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    We have attempted to use the entire string, the first portion, second portion, and just the technical response.  No luck.
    Perhaps this needs to go to a service request?
    Edited by: Nicholas Chu on Nov 30, 2009 8:26 PM

  • Query Based Report

    HI All,
    I have tried to make query to get the result of quotations against customer and sales order against but inorder to reflect it as per customer total i have used union all option.
    THE ISSUE IS I AM UNABLE TO PICK UP THE TOTAL AMOUNT AS PER CUSTOMER SAY CUSTOMER A HAVING 2 QUOTATIONS OF 1000 & 2000 SO I NEED TOTAL TO REFLECT AS PER CUSTOMER.ALSO TO MAKE IT MANAGEMENT REPORT I HAVE TO ADD THE COUNT OF TOTAL QUOTATIONS MADE AS PER CUSTOMER AND THE Number of
    Sales Orders Created     Value of Sales Orders     % Quotes/Sales Orders     
    Select  QuoteDate,CustomerName,QuoteTotal,QuoteNum,SOdate,SONum,SOTotal
    from (
    Select distinct  T0.[DocDate]QuoteDate, convert (varchar, T0.[CardName]) CustomerName,T0.[DocNum] QuoteNum, T0.[DocTotal] as QuoteTotal,T4.[DocNum] SONum,T4.[DocDate] SODate, T4.[DocTotal] as SOTotal
    From OQUT t0 INNER JOIN [dbo].[QUT1]  T1 ON T0.DocEntry = T1.DocEntry
    left join [dbo].[RDR1]  T3 on t0.docEntry=T3.Baseentry left JOIN ORDR T4
    ON T3.DocEntry = T4.DocEntry where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    Group By T0.[DocNum],T0.[DocDate],(T0.[DocTotal]),T0.[CardName], T4.[DocNum],T4.[DocDate],(T4.[DocTotal])
    union all
    Select Distinct  null DocDate,convert (varchar, T0.[CardName]) + ' ' +  'Total' CustomerName,null DocNum,null DocTotal ,null DocDate,null DocNum, null DocTotal
    From OQUT t0 INNER JOIN [dbo].[QUT1]  T1 ON T0.DocEntry = T1.DocEntry
    left join [dbo].[RDR1]  T3 on t0.docEntry=T3.Baseentry left JOIN ORDR T4
    ON T3.DocEntry = T4.DocEntry
    where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    Group By T0.[DocNum],T0.[CardName],T4.[CardName],T4.[DocNum]) a
    Order By
    CustomerName
    Thanks-
    Mona.

    Hi,
    It will not fulfill customers requirement.
    In the above query posted by me refer below example-
    Date               CustomerName                      Doc Num                                                                      Doctotal
    07/03/2012           ABC                                       1                                                                100
    07/03/2012           ABC                                       2                                                                 200
    Null                      ABC Total                            null                                                                                300
    Is it not possible to get 300 on query made by me.
    Thanks-
    Mona.

  • BW Query based Report - Design issue

    Hi,
    I have two BW queries.  One fetching the details for sales of all the states over a period of time and another one fetching the sales forecast of all the states over a period of time.  The users wishes to see both the sales and forecast in the same report.  Can I have both the queries in my crystal report as we do in traditional dbs.
    Thanks and Regards,
    Subbu S

    You may need to have 2 different Add-command and join those 2 and handle
    have query1 in command1
    have query2 in command2
    link the 2 commands with common key (this applies for both universe driven and query driven)
    This may help
    Thanks,
    Ganesh

  • Query based report to pick up the value from differences table

    Hi,
    I am trying to pick up the value from change log differences feild but since it is system variable i am unable to pick it.which table i should pick up to get that .
    Regards-
    Monica.

    Hi Monica,
    This would be a tough job if you know the structure of the historical record tables.  You need to familiar with all those A tables first.  Any changes to one of the record would create a instance of the record before change.  AITM is for OITM, AIT1 is for ITM1 etc.  Which tables are you looking for?
    Thanks,
    Gordon

  • SQL Query based BI Pub report - Taking too long to produce the output

    Hi All,
    I was trying to produce a BI Publisher based report through enterprise edition of BI Publisher 10.1.3.4
    Its a sql query based report and it has around 20 columns and it has around 1 lakh records.
    The query actually takes only 2 seconds to execute in the database but when we execute from BI Publisher it takes a long time and also it times out most of the time
    Is there something I am missing in the configuration options ?
    Thanks
    Shasi

    I am facing the same problem as well. I am using the Publisher Web service API to run a report with 1 Million records. This report is configured to use OBIEE. It takes a lot of time to generate the report ( around 30 Mins) and even though OBIEE generates the data, my web service client either timesout. Even after increasing the timeout, a 500 internal server error is thrown . Does anyone know of a solution to this.
    Thanks

  • Pricing reports,ABAP query based repors

    hai
    pls tel me the how to prepare the pricing reports as well as abap query based reports
    thanks in advance

    Dear sri vijay  ,
    Please read the rules of engagement before posting in forum
    Please search the forum before posting
    I am sure you will get lot of past threads related to ABAP Query and Pricing Reports.
    Thanks & Regards,
    Hegal K Charles

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

  • Query Based Problem

    HI Experts,
    I have Generated One Query based Report for Invoice Details
    I have Generated that report in Last Years Posting Period now Posting Period Has Been Changed
    Now if i will execute that report it will show correct data but while i will drill information from Invoice Number it will show previous years Documet.
    But all the other tax details and amount is from Current Posting Dates

    Hi
    The archiving functionality is from the 8.8 version only.
    But if in your query you display the DocEntry in side of the DocNum and use the link arrow at the DocEntry, it will go to the proper document.
    Best regards
    István Körö

  • RWI 00200 Error while scheduling the Bex Query based Webi report

    Dear All,
    I am facing the below error while scheduling the Bex Query based Webi report.
    Error:RWI 00200
    We are using BO XI 4.0 Sp05.
    Please advise

    Hi,
    I am on BO 4.0 SP05 Patch 6. Webi reports are just showing processing but not giving results. When I try to create new report it is throwing java security error.
    Tried applet patch upgrade(From link : https://websmp207.sap-ag.de/~sapidb/011000358700000902752013E) for webi certificate but didn't help.
    Please suggest what could be done.
    Thanks and Regards,
    Ankit Sharma

  • Select List (query based LOV) in a wizard created report form

    I have created an updatable report form with 3 columns:
    app_id
    user_id
    group_id
    Each app_id has multiple group_id's associated with it, and I want to show the group_id field as a Select List (query based LOV) that contains the groups associated with the app_id.
    My query for the select list needs to be similar to the following:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The problem is, I don't know how to reference the app_id from the main report to replace the ?????.
    In other words, if my report returns 2 rows of data like this:
    app_id----------user_id----------group_id
    1-----------------24------------------3
    2-----------------24------------------15
    Then how do I get the group_id column to be a select list of possible groups for each application? If app_id 1 has 3 groups associated with it, 3, 4, & 5 and app_id 2 has 2 groups associated with it, 15 & 16, then those each of the select lists should be based on the app_id.
    Hopefully I explained this clearly.
    Thanks,
    Kris

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • Dynamic sql query for report based on user input

    Hi everyone,
    I have built custom search fields (name, date born, gender etc.) in the search region and in the results region a report need to be displayed.
    Now I'm not very experienced with Apex or Oracle sql, but could anyone telll me how to first check if a user filled in a field and then build a query based upon what field the user filled in to submit.
    Any help would be appreciated, thanks in advance.
    regards,
    Cleo
    Edited by: Cleopatra on Jan 18, 2011 5:51 AM

    Hi, Cleopatra. Welcome to OTN!
    If you don't have too many fields instead of checking to see if they're filled in you can use OR conditions in yoru WHERE_CLAUSE to check for NULLS to ignore NULLS, something like (you will have to test this carefully!)
    AND some_column = NVL(:P24_1,some_column)the idea being that if the field is NULL then the column will match itself - in this case assuming the column itself does not have a null value

Maybe you are looking for

  • When using applications how much usage are you using or are you using none

    ive downloaded some free applications on to my iphone lie (facebook, myspace, webmessenger) when actually usually the applications does that use the usage that i get monthly how does it work.

  • Execute a sheel script (that is login to sqlplus and do some query) by ssh

    I have two unix box. lets say...box1's ip is : a.b.c.d and box2's ip is : w.x.y.z We have shared the public key by "ssh-keygen -t rsa" in both the box so that it will not prompt password for ssh connection. Now, in the 2nd box I wrote a shell script

  • Newbie help on COUNT functions

    Hi, I am new to Siebel/Answers, and I need to learn something about the COUNT funtions. I have a table of 102 numerical entries, where only one entry is 0. These are the results from the different COUNT functions COUNT(expr) = 129 COUNT(*) = 129 COUN

  • How to add custom ADF Tree Node icon

    Hi All, i am using below code in style sheet to set the tree node icon, af|tree::node-icon:nodetype-collapsed but i don't have any idea how to add getnodetype() method in the node class, (I am using Jdeveloper 11.1.1.2.0). please suggest me the steps

  • SCREEN scrambles colours

    The Screen Changes colours, from up, to left to rigth, from lines, to blocks, and diferent colors and shapes , then white, then grey, then lines in the midles, moving and flikering...I hook other monitor, and it dosent do it on the external,if its co