Query for Report Asset By Location

Dear All,
I want to record asset using add on SAP. I want to make a query report that show asset per location. I'm using field U_User01 to record location of FA. The report will contain Code of FA, Name of FA, location, Acquisition value, Accum Depr and Net book value. This report will be made per period.
Is there any one can help me to make the query ?
Thanks a lot for your help

Hai..is there anyone that can help me to solve this problem ? Thanks for the help

Similar Messages

  • Query for fa asset deprication

    HI 2 ALL
    Anybody have query which calculate asset reserve deprication in specific period.
    regards,
    zulqarnain

    Hi zulqarnain,
    from all of your recent queries, i understand that you are not aware of the table names in FA schema and also not sure as to which information is available at what table ....
    You can generate an asset trace from asset module for a particular asset, the output contains all table names with column details that helps all report developers if they are designing an asset related report ...
    Please perform the below steps and review the output ....
    Switch Responsibility to System Administrator
    Navigate to Security > Responsibility > Request
    Select/Query the request group for your Fixed Asset Responsibility (Standard group name is "All Reports and Programs")
    Insert new record/row in the Requests region and select the program name "Generate Asset Trace"
    Save your changes ..
    Switch responsibility to your Fixed Asset Responsibility
    Run the concurrent program "Generate Asset Trace" with the parameter value for Asset book and Asset number
    Check the output (it would generate two ..1st one will contain asset details 2nd one will have SLA/accounting details of the Asset)
    Regards,
    Ivruksha

  • Complex query for Reports

    Hi !!
    I have to create a report,which would be called from a form, and I require your help to code a query for a complex logic involving two tables. My application is on Oracle8i and Developer6. The table structures and their values are as below:
    Table1
    (Main-Part, Sub-Part is a composite key)
    MainPart Sub-part
    M0001 S0001
    M0001 S0002
    M0001 S0003
    M0002 S0004
    M0002 S0101
    M0002 S0909
    M0003 S1909
    Table2 (Part is a primary key)
    Part Qty-in-store qty-in-prodn qty-rejected
    M0001 10 10 10
    S0001 1 10 1
    M0003 1 1 1
    M0002 2 1 2
    S0004 3 2 5
    S0003 1 1 8
    S0002 10 11 12
    S0101 100 200 100
    The requirement is that for every fetch of the Main-Sub part pair from table1, details should be fetched from the table2. Since the Main-Sub part pair is a composite key in table1, details from Table2 should be fetched only once for a repeating Main part but as many times for the number of sub-parts. For example, although M0001 is repeated 3 times in table1, it's details should be fetched only once from table2 whereas for the sub-parts of M0001(S0001, S0002, S0003) details should be fetched from table2 for each sub-part.
    I tried a query which first fetches the details for the main-part, and in the repeating frame I put formula columns(with appropriate select stmts) for sub-parts. This approach I feel could affect performance because select statement is fired as many times as the number of formula columns.
    My report should look like this
    ============================================================
    Part qty-in-store qty-in-prodn qty-rejected
    ============================================================
    M0001 10 10 10
    S0001 1 10 1
    S0002 10 11 12
    S0003 1 1 8
    Total 22 32 31
    M0002 2 1 2
    S0004 3 2 5
    S0101 100 200 100
    Total 105 203 107
    I would like your help to know if there is another way to code a query(or queries) in report builder which will help me solve this above requirement.
    Also, is it possibe to do an Update operation on a Database Table from within a report, bcos the totals as shown above need to be updated to the table?
    Thanks in advance for the help?
    Regards,
    Ajay

    John,
    I believe this is to create the column types in BIRT. Can you open a
    bugzilla entry to look at this?
    Jason
    On 7/27/2010 10:45 AM, john mcteague wrote:
    > I have resolved this by changing config.xml in oda-jdbc.jar to use
    > policy 1 for the jConnect driver.
    >
    > Policy 2 executes the query with a maxrows of 1, gets the metadata then
    > executes the query again with the desired number of rows.
    > Does anyone know why jConnect was set to policy 2 in the first place?

  • How to modify select query for retrieve assets from assets tab and assets in merchandising in 10.1.2?

    Hi All,
          I need to modify the SQL for retrieving assets from assets tab and assets in merchandising in 10.1.2. I found the class for SQLQuery builder, but I want to change the SQL.
          Could you anyone please how to solve this.
    Thanks & Regards,
    Bala

    Hi All,
          I need to modify the SQL for retrieving assets from assets tab and assets in merchandising in 10.1.2. I found the class for SQLQuery builder, but I want to change the SQL.
          Could you anyone please how to solve this.
    Thanks & Regards,
    Bala

  • Query  for report to show Invoices, Payments and Discounts

    Hi All
    I am hoping someone can help me with this query.
    What the customer needs is the invoices for a specific date range, the payments applied to the invoices and the discount amount
    Eg...
    Invoice    payment   discount
    100         90              10   
    This would be easy to get from the ORCT and RCT2 tables.
    However, sometime the users add the payment on account and reconciles the invoices and a manual journal for the discounts.
    So it would be best to look at the OITR and ITR1 tables?
    This is what I have so far and it almost balances...
    I am using this query to create the report in crystal,
    To create the discount amount from the incoming payment window i said (T0.ReconSum - T3.TrsfrSum)
    I also took out the vat amount within that formula.
    With the amounts from the manual journal, i just took the amount as is.
    select T2.CardCode, T2.CardName, T0.SrcObjTyp, T0.SrcObjAbs, T0.ReconSum, T3.TrsfrSum, T4.ReconDate, T2.U_FundedNonFunded, (T5.Debit - T5.Credit), T6.PymntGroup
    from ITR1 T0
                 inner join OCRD T2 on T0.Shortname = T2.CardCode
                 left outer join ORCT T3 on T3.DocEntry = T0.SrcObjAbs  and T3.CardCode = T0.ShortName
                 inner join OITR T4 on T4.ReconNum = T0.ReconNum
                 left outer join JDT1 T5 on T5.TransId = T0.TransId and T5.ObjType = T0.SrcObjAbs and T0.ShortName = T5.ShortName
                 inner join OCTG T6 on T6.GroupNum = T2.GroupNum
                where T3.DocDate <= getdate() or T5.ContraAct = '1127331'
    the account 1127331 is the Discount GL account.
    Based on the example the Payment + discount = Invoices
    however not all the customers are balancing..
    any ideas? it looks like my query is getting only the invoices where a payment has been done. The amounts just dont seem to match.
    Thank you
    Jerusha

    hi
    I think your join with OJDT is wrong in this part : T5.ObjType = T0.SrcObjAbs
    you should write
    T5.ObjType = T0.SrcObjTyp
    (I think you don't need this part at all )
    try this:
    select T2.CardCode, T2.CardName, T0.SrcObjTyp, T0.SrcObjAbs, T0.ReconSum, T3.TrsfrSum, T4.ReconDate, T2.U_FundedNonFunded, (T5.Debit - T5.Credit), T6.PymntGroup
    from
    ITR1 T0
    inner
    join OITR T4 on T4.ReconNum = T0.ReconNum
    inner
    join OCRD T2 on T0.Shortname = T2.CardCode
    left
    outer join ORCT T3 on T3.DocEntry = T0.SrcObjAbs and T3.CardCode = T0.ShortName
    left
    outer join JDT1 T5 on T5.TransId = T0.TransId and T5.ObjType = T0.SrcObjTyp and T0.ShortName = T5.ShortName
    inner
    join OCTG T6 on T6.GroupNum = T2.GroupNum
    where
    T3.DocDate <= getdate() or T5.ContraAct =
    '1127331'
    please let me know if it works now
    shachar

  • SAP Query-for  Reporting   how to create and use it

    Hi SAP Gurus,
    i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
    also if you have any study material on steps on How to write and create queries for PP module
    thank you very much

    Hi
    Please refer below document
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Also refer below
    How to Create Infoset Query (SAP Query)
    Steps on how to proceed to create a Query:
    ADHOC QUERY
    A query can be created to extract information from master records  i.e  Infotypes.  For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
    Proceedure :  
    Decide on  the various Infotypes we  want to make the query.  Decide on the area where we  want to query  i.e  Global area or Standard area.  Standard area is client specific and globel area will include all clients.
    Menu : HR – PM – Admn -  Information System -  Adhoc Query
    Select area standard and select the  user group already created
    Creation of new query  :  
    TC SQ03  -  Select Environment – Select Standard Area -  Enter  --  If new user group is to be created, enter name of the user group, click on create and enter necessary information and  exit after saving
    TC SQ02  -  Enter name of the Infoset – Create – enter name of Infoset -  Data source -- >  Table join by basis table – give name of table e.g  pa0000 -  Enter -  Click on insert table if we  want to include more tables – give name of table one by one and after finishing,  place cursor on the joining lines and right click to delete unwanted relationships  - check  - and go back  - field groups  -  include all table fields  - click on generate button   -  go out
    TC SQ03  -  Select user group  -   eg.  Payroll
    Infoset  - Enter name of newly created Infoset 
    Assign users and Infosets  -  Assign infosets  -  put tick on payroll  - save and go back
    TC  PAAH  -  Expand the nodes and put tick on relevant fields depending upon necessity
    Save the query  by giving the same name as infoset for easyness..
    For executing a query which is already created
    1. Go to SQ01 transaction
    2. Go to Environment menu->query areas->std areas
    3. Then choose the user group where the query is created
    4. It will display all the queries created for the group.choose the query you want to executeand click execute.
    5. will take to the initial screen
    6. Enter the required parameters and execute
    Regards
    Ranga
    Message was edited by:
            Ranganathan Srinivasamurthy

  • Select Query for Report

    Hi All
    I have a table called Agent. Each Agent processes requests.
    So accordingly Request is another table.
    Now the Agent can process the request successfully, fail or it could be
    in progress.
    So accordingly I have a status column in the Request table which can have the following values
    New - when the request is allocated to the agent
    Open- When the agent opens the request
    Action- when the agent acted upon the request
    Sold - when the agent was successful in processing the request
    Fail - when the agent could not process the request
    In the Request table there is column called requestDate which is the
    date when the Request was first inserted (i.e when its New)
    Now whenever the agent acts upon the request from the front end
    the status change is logged in a RequestLog table.
    So when the agent changes the status to Open, an entry is logged into
    RequestLog table.
    So when the agent open the request an entry in the RequestLog table
    would go with the status as open , the reference of the requestId &
    the date on which the status is changed
    Similar entries will be logged for each request when the agent acts on
    the respective requests like if its Sold then the status will be sold,
    the date of sale & the corresponding request Id will be logged into the
    RequestLog table.
    In the Request table the status will be changed to "Open" or "Sold" but the
    requestDate will not change & it will remain the date when it was inserted
    Now I want to generate a Report which shows the list of all agents within a state
    with all total number of requests they have handled, how many are in Opened status,
    how many are in Sold status & how many are in Fail status. I also have to show the
    average time(in days) it took for each agent to Open the request, make the sale or qualify it
    as Fail. This average time I want it for an agent & not request specific.
    & In the end I have to show the grand total of all the requests handled by all the agents,
    grand total of opened status requests,grand total of Sold status requests,grand total of Fail status requests as well as the total average time it took to Open ,total average time it took to sale & total average time it takes to Fail
    I have dabbled with simple SQL but not a complex report type like above. So I would need help from all you experts.
    Here is what I plan to do
    my from clause would include the Agent, Request, RequestLog table
    where Request.requestdate between <fromDate> and <toDate>
    group by agent.agentname,
    Select would have count(agent.requestid),
    Now how do i show the list of Open requests, sold requests & fail requests in different columns since all these values are in the same column.
    Also I am aware of the average fnction but I need help on how to use the same in such a scenario.
    Do post your thoughts on the same.
    Regards

    Hi All
    I have made some queries to fetch the Report data. I would want you to post your comments on the same.
    This is my first query which returns the total count of request per dealer, how much are in open, sent & dead state & total per status.
    select AGENT.COMPANY_NAME,count(REQUEST.REQUEST_ID) TOTAL ,
    sum(decode(REQUEST.status,'Open',1,0)) OPEN,
    sum(decode(REQUEST.status,'Sent',1,0)) SENT,
    sum(decode(REQUEST.status,'Dead',1,0)) DEAD
    from AGENT, REQUEST
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y'
    and AGENT.DEALER_ID = REQUEST.DEALER_NUMBER
    group by grouping sets(AGENT.COMPANY_NAME, ())
    Then I have to retrieve the average number of days it takes to change the request to Open, average number of days it takes to change the request to Sent & average number of days it takes to change the request to Dead
    per Agent. The base date is stored in REQUEST table (request_date column) & the subsequent change of status is stored in activity_date column
    of ACTIVITY table
    Here is what I do get the average number of days it takes to change the status for the Agent
    select AGENT.COMPANY_NAME,
    avg( decode (REQUEST.status,'Open',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_OPEN,
    avg( decode (REQUEST.status,'Sent',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_SENT,
    avg( decode (REQUEST.status,'Dead',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_DEAD
    from REQUEST, ACTIVITY, AGENT
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y '
    and REQUEST.dealer_number = AGENT.DEALER_ID
    and REQUEST.STATUS = ACTIVITY.STATUS
    group by grouping sets(AGENT.COMPANY_NAME, ())
    I hope this is the right way for calculating average number of days
    Since most part of the queries is the same
    I tried to merge both the queries into one because I need to render the report in that fashion. But the moment I merge the query its giving absurd results.
    Do post your thoughts on the same
    Regards

  • Reg.write query for report

    Dear Experts
    I am MM consultant and I am in need of generate reports.I don't know how to get the data from two table. Pls help me
    with some codings
    Thanks
    Rajakumar.K

    Hi.....
    Check this... Here Iam joining MARA and MAKT tables.....
    data: begin of itab occurs 0,
          matnr like mara-matnr,             <----like this you can select no.of fields from MARA
          spras like makt-spras,             <----like this you declare ur internal table with no.of fields of MAKT table
          end of itab.    
    parameters: p_matnr like mara-matnr.      <------ Later according to this material number you can display details
    select p~matnr q~spras          <----with p~ you can declare no.of from MARA, but those should me mention in above ITAB , also MAKT with q~
             from
             mara as p                      <---- p is for first table fileds
             inner join                         <----- key word
             makt as q                          <----- q is for second table fields
              on p~matnr = q~matnr       <----this is for link
              into corresponding fields of table itab
              where p~matnr = p_matnr.       <------checking where condition with parameter
    loop at itab.
    write:/ itab-matnr,            <--------here you can display the fields which you defined in ITAB
              itab-spras.
    endloop.
    Also check this query....
    Here you can display all the details of that tables...
    data: begin of itab occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          end of itab.
    data: p_matnr like mara-matnr.
    select-options: g_matnr for p_matnr.              <------First change
    select p~matnr q~spras from mara as p inner join makt as q
              on p~matnr = q~matnr
              into corresponding fields of table itab
              where p~matnr in g_matnr.                   <----second change
    loop at itab.
    write:/ itab-matnr,
              itab-spras.
    endloop.
    Also check this code and get an idea about for all entries method and joining of more than two tables...
    data: begin of itab occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          end of itab.
    data: begin of jtab occurs 0,
          matnr like marc-matnr,
          werks like marc-werks,
          end of jtab.
    data: begin of t_out occurs 0,
          matnr like mara-matnr,
          spras like makt-spras,
          werks like marc-werks,
          end of t_out.
    data: p_matnr like mara-matnr.
    select-options: g_matnr for p_matnr.
    select p~matnr q~spras from mara as p inner join makt as q
              on p~matnr = q~matnr
              into corresponding fields of table itab
              where p~matnr in g_matnr.
    if itab[] is not initial.
      select * from marc into corresponding fields of table jtab
                for all entries in itab
                where matnr = itab-matnr.
    endif.
    loop at itab.
      t_out-matnr = itab-matnr.
      t_out-spras = itab-spras.
      read table jtab with key matnr = itab-matnr.
      if sy-subrc = 0.
        t_out-werks = jtab-werks.
      endif.
      append t_out.
      clear t_out.
    endloop.
    loop at t_out.
      write:/ t_out-matnr,
              t_out-spras,
              t_out-werks.
    endloop.
    All the best!!
    Thanks,
    Naveen.I

  • Query for reporting need to be tuned

    Hi,
    I working on aoracle 10.2.0.4 on solaris platform 32 GB physical memory.This database is being used for both daily transaction and reporting purpose.One of the reporting query taking high time..
    SQL> set autotrace traceonly
    SQL> select substr(tr_ldt,4,6),tr_di,sum(tr_val) from tr_all
    2 where tr_ay_bt>='15-APR-11'
    3 group by substr(tr_ldt,4,6),tr_di
    4 order by substr(tr_ldt,4,6),tr_di;
    Execution Plan
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 1488 | 37200 | 198K|
    | 1 | SORT GROUP BY | | 1488 | 37200 | 198K|
    | 2 | TABLE ACCESS FULL| TR_ALL | 6575K| 156M| 197K|
    Statistics
    1030 recursive calls
    0 db block gets
    721737 consistent gets
    624840 physical reads
    0 redo size
    1682 bytes sent via SQL*Net to client
    514 bytes received via SQL*Net from client
    4 SQL*Net roundtrips to/from client
    23 sorts (memory)
    0 sorts (disk)
    33 rows processed
    and i have tried autometic sql tuning...
    But the result of tuning task is null. No suggestion.
    Can u tell me how can i reduce the time of execution.
    1.The wait event involved is *'db file scatter read'*.
    I have index on tr_ldt column and bitmap index on tr_di column.
    Pls suggest how to tune this query????

    See template postings:
    [url https://forums.oracle.com/forums/thread.jspa?threadID=863295]How to post a sql tuning request
    [url https://forums.oracle.com/forums/thread.jspa?messageID=1812597]When your query takes too long
    The wait event involved is 'db file scatter read'.Subject to oracle version, "db file scattered read" is the expected wait event for a FULL TABLE SCAN where the blocks are not in the buffer cache and physical IO is required.
    where tr_ay_bt>='15-APR-11'As an aside, never rely on implicit conversions, use TO_DATE('15-APR-2011','DD-MON-YYYY').
    It wouldn't make a difference to your full table scan, unless the relevant column was indexed but an implcit datatype conversion was preventing usage thereof.
    I have index on tr_ldt column and bitmap index on tr_di column.But the query restricts by TR_AY_BT.
    If this is unindexed a full table scan is pretty much inevitable.
    In the continued absence of an index, perhaps doing the work in parallel is an option?

  • 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

  • Query for Fixed Asset Addon

    HI All,
    Hope you are fine.
    I want to following fields in the query but I am not sure from which tables I will get these details.
    SELECT T0.[U_ItemCode], T0.[U_AsstNum], T0.[U_User01] as 'Axapta No.' ,  T0.[U_Desc], T0.[U_SerNum], T0.[U_User02] as 'Asset Location', T0.[U_VendCode] as 'Supplier Code', T0.[U_VendDesc] as 'Supplier Name' , T0.[U_InvNum] as 'TCC P/L No.', T0.[U_AcqDate], T0.[U_RetDate] as 'Disposal date' , T0.[U_CapDate] FROM [dbo].[@BA_OAMD]  T0 WHERE T0.[U_StatusID] =[%1] ORDER BY T0.[U_AsstNum], T0.[U_ItemCode]
    And I want additional these fields.
    add the invoice number, the accumulative depreciation amount and the net book value
    Please help me on this.

    Hi,
    try below query
    SELECT T0.[ItemName], T0.[AssetItem], T0.[validFor] FROM OITM T0 WHERE T0.[validFor] ='Y' and  T0.[AssetItem] ='Y'
    you can choose here depriciation type too same as above..
    Regards
    Deepak Tyagi

  • SAP B1 query for  trial balance by Locations

    Hi team
    How i can take the trail report by location. or is there any query to take this report.
    Thanks
    Anantha Desai

    Hi,
    Please check this thread:
    http://scn.sap.com/thread/1188738
    Thanks & Regards,
    Nagarajan

  • Help with PL/SQL returning SQL query for Report

    Hi
    I have got a report which I have formatted as PL/SQL function body returning SQL query.
    I have the following code
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count("HELPDESK_CALL_ID) total_issues,' ||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'HELPDESK_CALL_TYPE_ID = :P9_call_type';
    end if;
    q := q || ' WHERE '|| w;
    return q;
    end;
    When I apply changes I get this error message
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00972: identifier is too long
    Any Idea where I maybe going wrong?

    thanks its compiling now but when I run the page I get this error message in the reports region
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    This is my code that I have at the momment.
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    we VARCHAR2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count(HELPDESK_CALL_ID) total_issues,' ||
    ' sum(decode(status,''Open'',1,0)) open_issues, ' ||
    ' sum(decode(status,''On-Hold'',1,0)) onhold_issues,' ||
    ' sum(decode(status,''Closed'',1,0)) closed_issues,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''High'',1,0),0)) open_high_prior,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''Medium'',1,0),0)) open_medium_prior, '||
    ' sum(decode(status,''Open'',decode
    (priority,''Low'',1,0),0)) open_low_prior '||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'where HELPDESK_CALL_TYPE_ID = :P9_call_type';
    we := 'Y';
    end if;
    if we = 'Y' then
    q := q ||w;
    end if;
    return q;
    end;
    I have a select list with a list of reports. what I am trying to do build an sql depending on what the :p9_call_type value is. -1 represents the display value of -All Reports- so if the user selects all reports it should display all results thus removing the where clause. However as my code stands when I user clicks on all reports he get the correct results for all reports. If the user selects anything else they get the error message above.

  • Sql query for report?

    Hi all
    I have one big table with column:
    code,street,data_type,credit,debt,saldo,date
    I was creating query like
    select sum(saldo),code from tableA where data_types=1 and date <'201010' group by code
    but cant expand this query to be as report like
    COLUMN1 COLUMN2 COLUMN3 COLUMN4
    sum(saldo) -where type=1 and date = '201201', sum(saldo) where type=2, sum(saldo) where date ='201205' , code
    whats best solution to report sums for diferent data_types on one line with just one code per lines?
    regards
    Gordan
    Edited by: useruseruser on May 14, 2013 10:52 AM

    Hi,
    something like this?
    WITH mydata AS
       SELECT 2 code, 1 data_type, TO_DATE('01/01/2012','DD/MM/YYYY') dt, 100 saldo FROM DUAL UNION ALL
       SELECT 2 code, 2 data_type, TO_DATE('01/02/2012','DD/MM/YYYY') dt,  50 saldo FROM DUAL UNION ALL
       SELECT 2 code, 2 data_type, TO_DATE('01/03/2012','DD/MM/YYYY') dt,  40 saldo FROM DUAL UNION ALL
       SELECT 2 code, 2 data_type, TO_DATE('01/04/2012','DD/MM/YYYY') dt,  80 saldo FROM DUAL UNION ALL
       SELECT 2 code, 2 data_type, TO_DATE('01/05/2012','DD/MM/YYYY') dt,  50 saldo FROM DUAL UNION ALL
       SELECT 5 code, 1 data_type, TO_DATE('01/01/2012','DD/MM/YYYY') dt, 200 saldo FROM DUAL UNION ALL
       SELECT 5 code, 2 data_type, TO_DATE('01/02/2012','DD/MM/YYYY') dt, 175 saldo FROM DUAL UNION ALL
       SELECT 5 code, 1 data_type, TO_DATE('01/03/2012','DD/MM/YYYY') dt, 300 saldo FROM DUAL UNION ALL
       SELECT 5 code, 2 data_type, TO_DATE('01/04/2012','DD/MM/YYYY') dt,  85 saldo FROM DUAL UNION ALL
       SELECT 5 code, 2 data_type, TO_DATE('01/05/2012','DD/MM/YYYY') dt,  85 saldo FROM DUAL
    SELECT SUM(CASE
                   WHEN data_type=1 AND TO_CHAR(dt,'YYYYMM')='201201'
                      THEN saldo
                END) col1
          , SUM(CASE
                  WHEN data_type=2
                     THEN saldo
                END) col2
          , SUM(CASE
                   WHEN TO_CHAR(dt,'YYYYMM')='201205'
                      THEN saldo
                END) col2
          , code
       FROM mydata
    GROUP BY code;
          COL1       COL2     COL2_1       CODE
           100        220         50          2
           200        345         85          5It's considered a good practice to mark questions as answered when the answers are satisfying your question or provide additional details.
    You seem to have a lot of questions unresolved:
    Handle:      useruseruser 
    Status Level:      Newbie (5)
    Registered:      Jun 25, 2007
    Total Posts:      468
    Total Questions:      75 (49 unresolved) Are they really all without answer?
    Regards.
    Al
    Edited by: Alberto Faenza on May 14, 2013 11:10 AM
    Code changed as initial post changed

  • Modification of Query for report

    Dear All,
    In inventory one standard report -- Material account distribution summary and RDF is INVTRACS.rdf. this report will give whole transaction activity amount between two days. but our clients needs details of quantity and cost for every transaction then i will sum all those amounts. for this one i was developed one query. If u ran standard report it will gives net activity amount like--12164931.9 and ran my query it gives total amount -- 12163701.9 .It's having diff . but this query is working for some branches i.e for some branches standard report net activity amount and i developed query is same, but for some branches it's comes diff. same query but it is works for some branches only. and report name is 'INVTRACS.rdf'. my requirement for all branches it should be equal to standard report output amount and my query out. pls any body help me .it's urgent.
    i was developed this query..
    select mtt.organization_id,
         mtts.transaction_type_name,
    --     mtts.TRANSACTION_SOURCE_NAME,
         msi.segment1 item_code,
         mtt.transaction_quantity,
         mtt.SHIPMENT_NUMBER,
         mtt.TRANSACTION_UOM,
         mtt.TRANSACTION_DATE,
         imt.TRANSACTION_SRC_HDR,
         houv.NAME     ,
         cid.UNIT_COST ,
         round(mtt.transaction_quantity*to_number(cid.UNIT_COST),4) total
    from mtl_material_transactions mtt,
         mtl_system_items msi,
         mtl_transaction_types mtts,
         INVFV_MATERIAL_TRANSACTIONS imt,
         hr_organization_units houv ,
         CST_INV_DISTRIBUTION_V cid
    where
    to_date(to_char(mtt.transaction_date,'dd-mon-yy')) between '01-jul-08' and '31-jul-08'
    --and mtt.organization_id = 115
    and msi.inventory_item_id = mtt.inventory_item_id
    and msi.organization_id = 105
    and cid.TRANSACTION_ID=mtt.TRANSACTION_ID
    and mtts.transaction_type_id = mtt.transaction_type_id
    and mtt.TRANSACTION_ID=imt.TRANSACTION_ID
    and cid.ACCOUNTING_LINE_TYPE='1'
    --and mtt.transaction_id = '588156'
    and mtt.ORGANIZATION_ID=houv.ORGANIZATION_ID
    and houv.NAME     = :p_name

    any body

Maybe you are looking for

  • Excel web access web part Refresh

    Dear All, Please let me adress my SharePoint issues to you. Current situation: I currently have an excel file stored in one of my sharepoint libraries. The excel file has two tabs. The first tab contains data exported from a sharepoint list (with dat

  • Photo album & gallery views mess up with links and lay out

    Hi, Am having a weird problem in album/gallery function. I added links on the album page, but after viewing the gallery, reverting back to the album the link stopped working (main problem), and in the gallery page the link does not appear in cases or

  • Standby Limit

    Hello, Is there any limit of configuring / creating physical and/or logical standby database in different oracle versions and different OSs? regards.

  • Post Benefits Configuration and Payroll Integration

    Hi Experts, We have completed our Benefit Configurations its  schedule to golive for 2015. Do help me with configuration / integration steps with Payroll . Payroll: We have gross payroll, third party is ADP Thanks Priya

  • Install LVRTE 2010 when already installed LVRTE 2012

    Hey, i lost track of installs on my PC. I think a LV application quits because of not installed LVRTE 2010. I have installed LV 2012, 2013 & 2014 I had also installed LVRTE 2012 (and obviously 6.1 (don't know where this comes from, but i see it in NI