Query with group by and max value

Hi,
I have a table with many values of VAR_TRIMESTRALE for each COD_ISIN so I would take only the rows, for each COD_ISIN, that have the maximum of VAR_TRIMESTRALE.
select *
from spr_isin_drm_to b
group by b.COD_ISIN
having max(b.VAR_TRIMESTRALE)
I have tried to write the query in this way but it's wrong.
How can I write the correct query?
Thanks, bye bye.

Hi,
This is an example of a "Top-N" query:
SELECT   *       -- or list, if you don't want to see r_num
FROM    (
        SELECT  b.*
        ,       RANK () OVER
                    ( PARTITION BY  cod_isin
                      ORDER BY    var_trimestrale   DESC
                    )  AS r_num
        FROM    spr_isin_drm_to    b
WHERE   r_num = 1
;

Similar Messages

  • Query to group min and max times

    Can anyone please tell me how to write the followinf query?
    USER DATE MIN_TIME MAX_TIME
    ASMITH 01/01/2000 06:01:01 17:01:01
    ASMITH 02/01/2000 06:08:01 17:06:01
    ASMITH 03/01/2000 06:01:01 17:01:01
    STIGER 01/01/2000 06:01:01 06:01:01
    I have 2 columns: USER and WORK_DATE
    I want to return the min(time) max(time) grouped per day and user.
    So for every user I want the start time and end time for everyday.
    Thanx

    select user, date, min(time), max(time)
       from table
    group by user, date
    Can anyone please tell me how to write the followinf query?
    USER DATE MIN_TIME MAX_TIME
    ASMITH 01/01/2000 06:01:01 17:01:01
    ASMITH 02/01/2000 06:08:01 17:06:01
    ASMITH 03/01/2000 06:01:01 17:01:01
    STIGER 01/01/2000 06:01:01 06:01:01
    I have 2 columns: USER and WORK_DATE
    I want to return the min(time) max(time) grouped per day and user.
    So for every user I want the start time and end time for everyday.
    Thanx

  • How to write a query with group by and order by for a date column

    I have a query:
    select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
    group by to_char(s.pdate,'Mon-yyyy')
    order by to_date(s.pdate,'Mon-yyyy')
    However, I got an error: not a GROUP By expression.
    If i just run: select count(*), to_char(s.pdate,'Mon-yyyy') as month from sTable s
    group by to_char(s.pdate,'Mon-yyyy')
    it is work fine.
    How to solve the problem.
    Thanks,
    Jen

    Jen,
    You can use this code
    with sTable as (select to_date('01/01/2009', 'dd/mm/yyyy') pdate,  1 code from dual union all
                  select to_date('02/02/2009', 'dd/mm/yyyy') a, 2 code from dual union all
                  select to_date('01/03/2009', 'dd/mm/yyyy') d, 3 code from dual union all
                  select to_date('05/04/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/05/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/06/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/07/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/08/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/09/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/10/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/11/2009', 'dd/mm/yyyy') g, 4 code from dual union all
                  select to_date('05/12/2009', 'dd/mm/yyyy') h, 5 code from dual)
    select cnt, to_char(to_date(mnt||'01', 'yyyymmdd'), 'Mon-yyyy')
      from (select count(*) cnt, to_char(s.pdate,'yyyymm') as mnt
              from sTable s
             group by to_char(s.pdate,'yyyymm')
             order by to_char(s.pdate,'yyyymm')
           CNT MONTH
             1 Jan-2009
             1 Feb-2009
             1 Mar-2009
             1 Apr-2009
             1 May-2009
             1 Jun-2009
             1 Jul-2009
             1 Aug-2009
             1 Sep-2009
             1 Oct-2009
             1 Nov-2009
             1 Dec-2009
    12 rows selectedyour problem was that you are using a expresión in the order by (to_date...) that is distinct to the query results (to_char...).
    Regards,
    Mike

  • Creating a  query with group function and non group function

    Could anyone help me with creating a query that contain single row function and multiple row function in Report6i.
    what i want to do basically is to create a query that will display sum of certain columns according to a column in that table

    You can either calculate a sum yourself, or let Reports do it for you.
    1. select sum(column) from table where ....
    This will just display the sum, not the records.
    2. Make a query: select column from table where ...
    Create a summary field. You can do it manually or with the report wizard.
    That will create a report like this:
       Column
           10
           20
           15
       ======
    Sum    45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to write EJB-QL query with IN notation and list values EJB3.0?

    hi,
    I would like to write an EJB-QL query where the query would return the objects whose name equals to one of the names in the list.
    SELECT DISTINCT OBJECT(feature) FROM MAPSHEET_LOCK feature WHERE feature.name IN ?1
    For ?1 I would like to pass in a list. How can I write this query?
    Thanks

    List<String> names;
    StringBuilder sb = new StringBuilder("SELECT DISTINCT OBJECT(feature) FROM MAPSHEET_LOCK feature WHERE feature.name IN (");
    String separator = "";
    for (String name : names) {
      sb.append(separator);
       sb.append("'");
       sb.append(name);
       sb.append("'");
       separator = ", ";
    sb.append(")");
    String ejbql = sb.toString();
    // Code for execute query
    ....Message was edited by:
    Rulas

  • Min and MAx Value in a SELECT Statement

    Hi,
    I have a scenario where I am Selecting the values BETWEEN MIN and MAX values:
    SELECT * FROM ABC WHERE CODE BETWEEN MIN(CODE) AND MAX(CODE)
    ITS GETTING Error as:ORA-00934: group function is not allowed here
    Any help will be needful for me.

    select substr(no,1,3)||to_char(substr(no,4,1)+1) "first missing number"
    from
    with t as
    (select 'ABC1' no from dual
    union select 'ABC2' from dual
    union select 'ABC3' from dual
    union select 'ABC5' from dual
    union select 'ABC6' from dual
    union select 'ABC8' from dual
    select no, lead(no,1,0) over (order by no) next_no from t
    where substr(next_no,4,1) - substr(no,4,1) > 1
    and rownum = 1;

  • Highlighting Min and Max Values on each line

    Hello,
    Is it possible to highlight the Min and Max values on each row of a Query. For example I have sales below by product line for the last seven quarters. The user
    would like the Max value (150) for Product Line ABC Highlighted as Green and the Min value (1055) color coded as Red. Like wise for each line - DEF 200 as green and 100 as red and GHI - 400 as green and 100 as red.
    FYQ Q207 Q307 Q407 Q108 Q208 Q308 Q408
    ABC     1500     1200     1400     1050     1100     1100     1100
    DEF     1550     1000     1560     1220     1340     1640     2000
    GHI     1000     2000     3000     4000     3250     2220     3750
    Is this possible using Exceptions? or may be any other means? We are on Bex 7.0
    Best Regards,
    Sanjiv

    Hello Sanjiv,  
    I think it can be done by JavaScript, but needs more effort
    [Use of JavaScript Functions|http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a853bc623c075e10000000a114084/content.htm]
    Try the exception available in the BW[BW Stylesheets|http://help.sap.com/saphelp_nw04/helpdata/en/3f/ca453afbf37b54e10000000a11402f/content.htm]
    SAPBEXformats - Formatting cell (scaling factors)
    SAPBEXexcGood1 - Exception with priority good 1
    SAPBEXexcGood2 - Exception with priority good 2
    SAPBEXexcGood3 - Exception with priority good 3
    SAPBEXexcCritical4 - Exception with priority critical 4
    SAPBEXexcCritical5 - Exception with priority critical 5
    SAPBEXexcCritical6 - Exception with priority critical 6
    SAPBEXexcBad7 - Exception with priority bad 7
    SAPBEXexcBad8 - Exception with priority bad 8
    SAPBEXexcBad9 - Exception with priority bad 9
    See this thread,
    Change the colour of a cell text depending on the value Web Reports (NW04s)
    Thanks
    Chandran
    Edited by: Chandran Ganesan on Mar 19, 2008 4:27 PM

  • Min and Max values from entire table

     Hi,
     i have requirement in which i need to find the min and max values from the entire table.
    See the sample data 
    create table test
    Sal1 int,
    Sal2 int,
    Sal3 int
    insert into test values (100,700,5700)
    insert into test values (200,3300,5300)
    insert into test values (4400,1200,3500)
    insert into test values (5400,5600,3100)
    i want the output as 100 and 5700.. how can i achieve this in a single query. Please through some light on this topic..!
    Thanking you in advance
    Regards,
    Balaji Prasad B
    Balaji - BI Developer

    Below is an example with a subquery for each of the queries Mohammad posted in order to return both min and max in a single result set.
    SELECT ( SELECT MAX(Maxx) AS Maxx
    FROM test UNPIVOT
    ( Maxx FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Maxx
    , ( SELECT MIN(Minn) Minn
    FROM test UNPIVOT
    ( Minn FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Minxx;
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How do I create a folder or report from a query with a union and parameters

    I have created folders with unions but I am having difficulty coverting a query with a union and parameters.
    The following works great in SQL*Developer without parameters, but I want to change to use parameters for the year and quarter and use it in Discoverer:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
      AV.FIRM_NAME VENDOR_NAME,
      AV.BIDCLASS CONTRACT_CODES,
      AV.AWAMT AWARD_AMOUNT,
      AV.SOL_MODE FORMAL_INFORMAL,
      AV.CERT BUSINESS_ENTITY,
      AV.ETHNICITY ETHNICTY,
      AV.PO_NUMBER_FORMAT CONTRACT,
      SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
      CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID       = VP.VENDOR_ID ) )
    AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')
    AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
      AV.FIRM_NAME,
      AV.BIDCLASS,
      AV.AWAMT,
      AV.SOL_MODE,
      AV.CERT,
      AV.ETHNICITY,
      AV.PO_NUMBER_FORMAT
      union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
      AV2.FIRM_NAME VENDOR_NAME,
      AV2.BIDCLASS CONTRACT_CODES,
      AV2.AWAMT AWARD_AMOUNT,
      AV2.SOL_MODE FORMAL_INFORMAL,
      AV2.CERT BUSINESS_ENTITY,
      AV2.ETHNICITY ETHNICTY,
      AV2.PO_NUMBER_FORMAT CONTRACT,
      0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
                  FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
                 WHERE av2.po_number = vp2.po_number
                       AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = '4')
                       AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = '2009' ))
    AND (TO_CHAR(AV2.AWDATE,'Q') = '4')
    AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
      AV2.FIRM_NAME,
      AV2.BIDCLASS,
      AV2.AWAMT,
      AV2.SOL_MODE,
      AV2.CERT,
      AV2.ETHNICITY,
      AV2.PO_NUMBER_FORMAT Can someone provide a solution?
    Thank you,
    Robert

    Hi,
    You can take the parameters to the select so that you will be able to create conditions over them.
    Try to use this SQL instead of your and in the discoverer workbook create the conditions and parameters:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
    AV.FIRM_NAME VENDOR_NAME,
    AV.BIDCLASS CONTRACT_CODES,
    AV.AWAMT AWARD_AMOUNT,
    AV.SOL_MODE FORMAL_INFORMAL,
    AV.CERT BUSINESS_ENTITY,
    AV.ETHNICITY ETHNICTY,
    AV.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
    CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID = VP.VENDOR_ID ) )
    --AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')*
    --AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )*
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
    AV.FIRM_NAME,
    AV.BIDCLASS,
    AV.AWAMT,
    AV.SOL_MODE,
    AV.CERT,
    AV.ETHNICITY,
    AV.PO_NUMBER_FORMAT ,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
    AV2.FIRM_NAME VENDOR_NAME,
    AV2.BIDCLASS CONTRACT_CODES,
    AV2.AWAMT AWARD_AMOUNT,
    AV2.SOL_MODE FORMAL_INFORMAL,
    AV2.CERT BUSINESS_ENTITY,
    AV2.ETHNICITY ETHNICTY,
    AV2.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
    FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
    WHERE av2.po_number = vp2.po_number
    AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = TO_CHAR(VP.PAYMENT_DATE,'Q') )
    AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = TO_CHAR(VP.PAYMENT_DATE,'YYYY') ))
    --AND (TO_CHAR(AV2.AWDATE,'Q') = '4')*
    --AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')*
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
    AV2.FIRM_NAME,
    AV2.BIDCLASS,
    AV2.AWAMT,
    AV2.SOL_MODE,
    AV2.CERT,
    AV2.ETHNICITY,
    AV2.PO_NUMBER_FORMAT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    Tamir

  • Quality parameter -min and max values should be maintained w.r.to contract?

    Hi all,
    Min and max values in quantity contract should be maintained with respect to contract. till now we were maintaing min and max values with respect to inspection plans, but here since it differs for customer/vendor contracts - it need to be with respect to that. kindly suggest me on this
    regards,
    Soumya

    In the Material Assignment TAB of the Inspection Plan Header, you can maintain or assign Vendor/Customer. These specifications will be assigned automatically for the Purchase Orders/Sales Orders for the Material/Vendor or Material /Customer Combination at Plant Level.
    Check this and revert back.
    Best Regards,
    Raghavendra Nayak

  • Calculating min and max value from number array

    I have array which is having return type Number.i want to calculate min and max value of this array..try to help asap..
    Thanks
    dhanu

    hi there,
    public class MinMax {
         int arr[]= { 27, 3, 42, 18, 243, -43, 6, -8 };
         int min, max;
         public MinMax() {
    // it's very bad way to do it.
    //          min=99999;
    //          max=-99999;
    // this must be as following
                    min = max = arr[0];
              search();
              System.out.println("The minimum value is: "+min);
              System.out.println("The maximum value is: "+max);
         private void search() {
    // and here we can search from <1> index instead of <0>
              for (int j=1; j<arr.length; j++) {
                   if (arr[j]<min) {
                        min=arr[j];
                   else if (arr[j]>max) {
                        max=arr[j];
         public static void main(String args[]) {
              new MinMax();
    there is a bug in the supplied code. Your homework is
    to figure out what it is without posting another
    message for help with your homework.well, i think it's a tragedy :(

  • Sqlserver query using Group by and Order by

    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    MIN(BILL_DETAIL.x_cost_rate) as COST_RATE,
    MIN(BILL_DETAIL.x_cost_total) as COST_TYPE,
    LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
    FROM table_x_gsa_bill_detail BILL_DETAIL
    WHERE (1=1)
    GROUP BY (DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS || ',' || COST_TYPE || ',' || BILL_RATE)
    ORDER BY DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS ||
    ) dt WHERE rn BETWEEN 0 AND 1
    Can any one pls help me using of Case Condition keyword instead of Decode in the above query ??? iam not able to convert above query for group by and order by..
    Actually i need to do group by the aggragate values which i got the values from the fields of BILLABLE_YN,BILLABLE_TO,DETAIL_CLASS, COST_TYPE, BILL_RATE.
    where as in oracle i can run above query using decode keyword where as in sqlserver iam not able to use BILLABLE_YN field alias of above query in group by .
    i tried like by using following way but it is wrong because here iam not using aggragate values of fields in group by funtion please help me in converting query in sqlserver. GROUP BY (case BILLABLE_YN when 1 then 'Billable' when 0 then 'Non-Billable' else
    'Non-Billable' End BILLABLE_YN + ',' + BILLABLE_TO + ',' + DETAIL_CLASS + ',' + COST_TYPE + ',' + BILL_RATE)
    Krishna

    CREATE TABLE DETAIL
    ([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
    [x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
    INSERT INTO
    DETAIL
    ([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
    VALUES
    (1, 'Customer', 3, 1, 20,'Parking'),
    (2, 'Customer', 1, 1, 25,'Toll'),
    (3, 'Customer', 2, 1, 20,'Parking') 
    Pls convert following query for executing query in sqlserver  ..for the column ID_List it should return data like 1,2,3
    SELECT * FROM (SELECT 1 rn,
            SUM(BILL_DETAIL.x_bill_quantity)      as BILL_QUANTITY,
            MIN(BILL_DETAIL.x_billable_to)        as BILLABLE_TO,
            MIN(BILL_DETAIL.x_billable_yn)        as BILLABLE_YN,
            AVG(BILL_DETAIL.x_bill_rate)          as BILL_RATE,
            LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
         FROM   BILL_DETAIL
          WHERE (1=1)
     GROUP BY (DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate)
          ORDER BY DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to  +  ',' + COST_TYPE + ',' + x_bill_rate
           )dt 
    WHERE rn BETWEEN 0 AND 1
    Krishna
    sounds like this
    SELECT *
    FROM
    SELECT 1 rn,
    SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
    MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
    MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
    AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1) AS ID_Listing
    FROM BILL_DETAIL bd
    CROSS APPLY (
    SELECT BILL_DETAIL.objid + ',' AS [text()]
    FROM BILL_DETAIL
    WHERE objid = bd.objid
    FOR XML PATH('')
    )bd1(ID_LIST)
    WHERE (1=1)
    GROUP BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    ORDER BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
    LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
    )dt
    WHERE rn BETWEEN 0 AND 1
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Absolute dynamic select query with dynamic join and where

    Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
    I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
    Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
        SELECT (FIELDS) INTO TABLE IT_TABLES
          FROM ( (ME->TABLE1)  inner join ( me->table2 )
          on ( on_condition ) )
          WHERE (me->where_fields).
    Ags.

    It worked for me in a following way:
    select * into corresponding fields of table <result_table>
            from (join_string)
            where (l_where).
    Where the contents of join_string were dynamically build using concatenation. So it will be something like
    concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
    <...>
    add here matching/reference colums, something like
    concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
    concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
    concatenate join_string temp1 '=' temp2 into join_string separated by space.
    <...>
    concatenate join_string ')' into join_string separated by space.
    And then use similar approach for l_where variable.

  • Medium, min, and max values on ALV

    Hi friends ! How are are you ? Fine ?
    How can i calc medium, min, and max values on ALV ?
    Thanks !

    Hi Fabrício
    I think you set fieldcatalog at runtime dynamically to arrange dynamic columns. So, while you are setting it just set proper values to the attribute "do_sum" for relevant fields.
    For more information how to set fieldcatalog dynamically, you can refer to the tutorial "An Easy Reference for ALV Grid Control".
    Regards
    *--Serdar [[ BC ] | https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk sag jiw=]

  • Query with MARA MVKE and MAST

    Hi
      Im trying to create a query with MARA, MVKE and MAST tables. If corresponding records exist in all the 3 tables, I get output. Otherwise, I get the result as 'No data selected'. I tried using left outer join with MAST , tried using MARC also between MARA and MAST but its of no use. Please suggest how I can both get the sales data and BOM details in the output.
    Thanks
    Aparna

    Hi Aparna,
    Goto  SE16 Check in table,
    1.KDST -
    Sales order to BOM link
    2.STKO -
    BOM - header
    3.STPO -
    BOM - item
    And also you create a query and check the out put.

Maybe you are looking for

  • HT5824 Can I tranfer my recently edited contacts on my pc to my iphone and ipad?

    I have just signed into icloud.com on my windows 7 computer and edited my large contact list.  Can I transfer this to my iphone and ipad?

  • Siebel Analytics Help

    Hello Everyone, I am trying to locate some forum on or technical pages on Siebel Analytics. Does anyone has clue on where can i get these. Thanks in advance Rishi

  • User dont have permission to update this object

    Dear Experts, I have exported a from into OIM and tried to give permissions of some groups via "object permission" tab. but I am getting an error message "user dont have permission to update this object". Then I looked into (Business rule definition)

  • 1 PO & 4 GRs

    Hai gururs we have one purchase order for that four GRs , when i am trying to do MIRO ( invoice verification ) , all 4GRs are showing in One . But i want individual Line Items to post  MIRO Pl suggest the ways Regards Srinivasan

  • Google Apps email (Exchange)

    Hi- I am having trouble with mail flags in iOS7. I have an iPhone 5 and when I go to flag an email in my Google Apps account, the option simply isn't there. I can flag it in other clients (Postbox for OSX, Gmail for iOS) and the flags transfer everyw