How to get top 11 values per date range

I want to get the top 11 values by date range.
Sample Data
CREATE TABLE SAMPLE_DATA
    DOMAIN_NAME VARCHAR2(100),
    QTD         NUMBER,
    LOAD_DATE   DATE
-- Insert
BEGIN
  FOR lc IN 1..20
  LOOP
    FOR ld IN 1..30
    LOOP
      INSERT
      INTO SAMPLE_DATA VALUES
          'DM_'
          ||lc,
          round(dbms_random.value(0,1000)),
          SYSDATE-ld
    END LOOP;
  END LOOP;
COMMIT;
END;
SELECT *
FROM
  (SELECT DOMAIN_NAME,
    QTD,
    LOAD_DATE
  FROM
    (SELECT DOMAIN_NAME,
      QTD,
      LOAD_DATE
    FROM SAMPLE_DATA
    WHERE LOAD_DATE = TRUNC(SYSDATE-3)
    ORDER BY QTD DESC
  WHERE ROWNUM <=10
  UNION ALL
  SELECT 'Others' DOMAIN_NAME,
    SUM(QTD) QTD,
    LOAD_DATE
  FROM
    (SELECT DOMAIN_NAME,
      QTD,
      LOAD_DATE
    FROM
      (SELECT rownum rn,
        DOMAIN_NAME,
        QTD,
        LOAD_DATE
      FROM
        (SELECT DOMAIN_NAME,
          QTD,
          LOAD_DATE
        FROM SAMPLE_DATA
        WHERE LOAD_DATE = TRUNC(SYSDATE-3)
        ORDER BY QTD DESC
    WHERE rn > 10
  GROUP BY LOAD_DATE
ORDER BY QTD DESC
-- Result
DOMAIN_NAME                 QTD                         LOAD_DATE                  
Others                      2888                        24/03/13                   
DM_1                        1000                        24/03/13                   
DM_20                       933                         24/03/13                   
DM_11                       913                         24/03/13                   
DM_3                        743                         24/03/13                   
DM_13                       572                         24/03/13                   
DM_12                       568                         24/03/13                   
DM_9                        564                         24/03/13                   
DM_6                        505                         24/03/13                   
DM_5                        504                         24/03/13                   
DM_2                        480                         24/03/13    
Please, Help me get in one query this result using a range of date.
e.g
using LOAD_DATE BETWEEN '24/03/13' AND '25/03/13'
DOMAIN_NAME                 QTD                         LOAD_DATE                  
Others                      2888                        24/03/13                   
DM_1                        1000                        24/03/13                   
DM_20                       933                         24/03/13                   
DM_11                       913                         24/03/13                   
DM_3                        743                         24/03/13                   
DM_13                       572                         24/03/13                   
DM_12                       568                         24/03/13                   
DM_9                        564                         24/03/13                   
DM_6                        505                         24/03/13                   
DM_5                        504                         24/03/13                   
DM_2                        480                         24/03/13                     
Others                      1948                        25/03/13                   
DM_1                        807                         25/03/13                   
DM_8                        764                         25/03/13                   
DM_7                        761                         25/03/13                   
DM_11                       656                         25/03/13                   
DM_18                       611                         25/03/13                   
DM_17                       523                         25/03/13                   
DM_14                       467                         25/03/13                   
DM_19                       447                         25/03/13                   
DM_15                       437                         25/03/13                   
DM_6                        380                         25/03/13             Thank you in advance.

I got the solution. Just sharing.
I used analytic functions that make my job easy.
Sample Data
DOMAIN_NAME                 QTD                         LOAD_DATE                  
DM_1                        807                         25/03/2013                 
DM_1                        1000                        24/03/2013                 
DM_2                        226                         25/03/2013                 
DM_2                        480                         24/03/2013                 
DM_3                        244                         25/03/2013                 
DM_3                        743                         24/03/2013                 
DM_4                        48                          25/03/2013                 
DM_4                        413                         24/03/2013                 
DM_5                        164                         25/03/2013                 
DM_5                        504                         24/03/2013                 
DM_6                        380                         25/03/2013                 
DM_6                        505                         24/03/2013                 
DM_7                        761                         25/03/2013                 
DM_7                        212                         24/03/2013                 
DM_8                        764                         25/03/2013                 
DM_8                        308                         24/03/2013                 
DM_9                        354                         25/03/2013                 
DM_9                        564                         24/03/2013                 
DM_10                       214                         25/03/2013                 
DM_10                       367                         24/03/2013                 
DM_11                       656                         25/03/2013                 
DM_11                       913                         24/03/2013                 
DM_12                       37                          25/03/2013                 
DM_12                       568                         24/03/2013                 
DM_13                       332                         25/03/2013                 
DM_13                       572                         24/03/2013                 
DM_14                       467                         25/03/2013                 
DM_14                       87                          24/03/2013                 
DM_15                       437                         25/03/2013                 
DM_15                       450                         24/03/2013                 
DM_16                       238                         25/03/2013                 
DM_16                       299                         24/03/2013                 
DM_17                       523                         25/03/2013                 
DM_17                       143                         24/03/2013                 
DM_18                       611                         25/03/2013                 
DM_18                       145                         24/03/2013                 
DM_19                       447                         25/03/2013                 
DM_19                       464                         24/03/2013                 
DM_20                       91                          25/03/2013                 
DM_20                       933                         24/03/2013                  Top 11 QTD of DOMAIN_NAME per Data Range.
SELECT *
FROM
  (SELECT DOMAIN_NAME,
    QTD,
    LOAD_DATE
  FROM
    (SELECT LOAD_DATE,
      DOMAIN_NAME ,
      QTD,
      (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
    FROM SAMPLE_DATA
    WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
  WHERE RANK_QTD <= 10
  UNION ALL
  SELECT 'Others',
    SUM(QTD) AS QTD,
    LOAD_DATE
  FROM
    (SELECT LOAD_DATE,
      DOMAIN_NAME ,
      QTD,
      (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
    FROM SAMPLE_DATA
    WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
  WHERE RANK_QTD > 10
  GROUP BY LOAD_DATE
ORDER BY LOAD_DATE ASC,
  QTD DESC
DOMAIN_NAME                 QTD                         LOAD_DATE                  
Others                      2888                        24/03/2013                 
DM_1                        1000                        24/03/2013                 
DM_20                       933                         24/03/2013                 
DM_11                       913                         24/03/2013                 
DM_3                        743                         24/03/2013                 
DM_13                       572                         24/03/2013                 
DM_12                       568                         24/03/2013                 
DM_9                        564                         24/03/2013                 
DM_6                        505                         24/03/2013                 
DM_5                        504                         24/03/2013                 
DM_2                        480                         24/03/2013                 
Others                      1948                        25/03/2013                 
DM_1                        807                         25/03/2013                 
DM_8                        764                         25/03/2013                 
DM_7                        761                         25/03/2013                 
DM_11                       656                         25/03/2013                 
DM_18                       611                         25/03/2013                 
DM_17                       523                         25/03/2013                 
DM_14                       467                         25/03/2013                 
DM_19                       447                         25/03/2013                 
DM_15                       437                         25/03/2013                 
DM_6                        380                         25/03/2013 

Similar Messages

  • SUM(Case how to use this structure to get average values over date range

    I am using:
    Oracle SQL Developer (3.0.04) Build MAin-04.34 Oracle Database 11g Enterprise Edition 11.2.0.1.0 - 64bit Production
    How do I use the sum function with a case structure inside.
    so I have data that looks like has an ID, date, and value. I am looking to get the 7 day average for the date range of 4/1/2013 thru 4/20/2013
    with t as (
    select 1 ID_Key,to_date('4/1/2013','mm-dd-yyyy') date_val, 10 Value_num from dual union all
    select 1 ID_key,to_date('4/2/2013','mm-dd-yyyy'), 15 from dual union all
    select 1 ID_key,to_date('4/3/2013','mm-dd-yyyy'), 20 from dual union all
    select 1 ID_key,to_date('4/5/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/8/2013','mm-dd-yyyy'), 12 from dual union all
    select 1 ID_key,to_date('4/9/2013','mm-dd-yyyy'), 8 from dual union all
    select 1 ID_key,to_date('4/10/2013','mm-dd-yyyy'), 6 from dual union all
    select 1 ID_key,to_date('4/12/2013','mm-dd-yyyy'), 10 from dual union all
    select 1 ID_key,to_date('4/13/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/14/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/15/2013','mm-dd-yyyy'), 10 from dual union all
    select 1 ID_key,to_date('4/16/2013','mm-dd-yyyy'), 5 from dual union all
    select 1 ID_key,to_date('4/17/2013','mm-dd-yyyy'), 2 from dual union all
    select 1 ID_key,to_date('4/20/2013','mm-dd-yyyy'), 3 from dual union all
    select 2 ID_key,to_date('4/3/2013','mm-dd-yyyy'), 12 from dual union all
    select 2 ID_key,to_date('4/5/2013','mm-dd-yyyy'), 15 from dual union all
    select 2 ID_key,to_date('4/6/2013','mm-dd-yyyy'), 5 from dual union all
    select 2 ID_key,to_date('4/7/2013','mm-dd-yyyy'), 7 from dual union all
    select 2 ID_key,to_date('4/9/2013','mm-dd-yyyy'), 10 from dual union all
    select 2 ID_key,to_date('4/11/2013','mm-dd-yyyy'), 5 from dual union all
    select 2 ID_key,to_date('4/12/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/13/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/15/2013','mm-dd-yyyy'), 6 from dual union all
    select 2 ID_key,to_date('4/16/2013','mm-dd-yyyy'), 8 from dual union all
    select 2 ID_key,to_date('4/17/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/18/2013','mm-dd-yyyy'), 10 from dual union all
    select 2 ID_key,to_date('4/19/2013','mm-dd-yyyy'), 5 from dual
    )**Please let me know if the table does not load.
    I would like to get the 7 day average as long as there is date for that row has enough previous dates, it not then it will return null.
    the results should look like this
    ID_Key      date_val     Value_num     7Day_Avg     7Day_Avg2
    1     4/1/2013     10          null          null
    1     4/2/2013     15          null          null
    1     4/3/2013     20          null          null
    1     4/5/2013     0          null          null
    1     4/8/2013     12          6.71          11.75
    1     4/9/2013     8          5.71          10.00
    1     4/10/2013     6          3.71          6.50
    1     4/12/2013     10          5.14          9.00
    1     4/13/2013     0          5.14          7.20
    1     4/14/2013     0          5.14          6.00
    1     4/15/2013     10          4.86          5.67
    1     4/16/2013     5          4.42          5.17
    1     4/17/2013     2          3.85          4.50
    1     4/20/2013     3          2.86          4.00
    2     4/3/2013     12          null          null
    2     4/5/2013     15          null          null
    2     4/6/2013     5          null          null
    2     4/7/2013     7          5.57          9.75
    2     4/9/2013     10          7.00          9.80
    2     4/11/2013     5          6.00          8.40
    2     4/12/2013     0          3.86          5.40
    2     4/13/2013     0          3.14          4.40
    2     4/15/2013     6          3.00          4.20
    2     4/16/2013     8          2.71          3.80
    2     4/17/2013     0          2.71          3.17
    2     4/18/2013     10          3.43          4.00
    2     4/19/2013     5          4.14          4.83As you may notice, there are gaps in the dates, so the value are then treated as zeros for the 7Day_Avg and then ignored for teh 7Day_Avg2 (not counted as number of days averaged do to no valu_num row)
    I was trying something like this to start, but getting error "missing keyword"
    select
    t.*/,
    sum(
          case
            when date_val between :day2 - 6 and :day2
            then value_num between date_val - 6 and date_val
            else null
            end
            as 7Day_avg
    form tShould I have the case structure outside the sum function?
    Any thoughts??
    Edited by: 1004407 on Jun 7, 2013 11:06 AM

    Hi,
    If you want the average of the last 7 days, including the current day, then then RANGE should be 6 PRECEDING, not 7.
    Try this:
    WITH     got_min_date_val AS
            SELECT  id_key, date_val, value_num
            ,       MIN (date_val) OVER () AS min_date_val
            FROM    t
            WHERE  date_val BETWEEN TO_DATE ('04-01-2013', 'mm-dd-yyyy')
                             AND   TO_DATE ('04-20-2013', 'mm-dd-yyyy')
    SELECT    id_key, date_val, value_num
    ,         CASE
                  WHEN  date_val >= min_date_val + 6
                  THEN  SUM (value_num) OVER ( PARTITION BY  id_key
                                               ORDER BY      date_val
                                               RANGE         6 PRECEDING
                        / 7
              END  AS avg_7_day
    ,         CASE
                  WHEN  date_val >= min_date_val + 6
                  THEN  AVG (value_num) OVER ( PARTITION BY  id_key
                                               ORDER BY      date_val
                                               RANGE         6 PRECEDING
              END   AS avg_7_day_2
    FROM      got_min_date_val
    ORDER BY  id_key
    ,         date_val
    Output:
       ID_KEY DATE_VAL   VALUE_NUM  AVG_7_DAY  AVG_7_DAY_2
             1 01-APR-13         10
             1 02-APR-13         15
             1 03-APR-13         20
             1 05-APR-13          0
             1 08-APR-13         12       6.71        11.75
             1 09-APR-13          8       5.71        10.00
             1 10-APR-13          6       3.71         6.50
             1 12-APR-13         10       5.14         9.00
             1 13-APR-13          0       5.14         7.20
             1 14-APR-13          0       5.14         6.00
             1 15-APR-13         10       4.86         5.67
             1 16-APR-13          5       4.43         5.17
             1 17-APR-13          2       3.86         4.50
             1 20-APR-13          3       2.86         4.00
             2 03-APR-13         12
             2 05-APR-13         15
             2 06-APR-13          5
             2 07-APR-13          7       5.57         9.75
             2 09-APR-13         10       7.00         9.80
             2 11-APR-13          5       6.00         8.40
             2 12-APR-13          0       3.86         5.40
             2 13-APR-13          0       3.14         4.40
             2 15-APR-13          6       3.00         4.20
             2 16-APR-13          8       2.71         3.80
             2 17-APR-13          0       2.71         3.17
             2 18-APR-13         10       3.43         4.00
             2 19-APR-13          5       4.14         4.83
    Message was edited by: FrankKulash
    Sorry; I meant to reply to OP, not to Greg

  • How to make default values for date range?

    Dear Colleagues,
    My customer is asking for a default value for a date range prompt.
    The FromDate should contain the 1st of current month, the ToDate should contain current date.
    Does anyone have any idea how I can meet this demand?
    Regards Silje

    Hi Federico,
    Thank you for the answer, we are back to the challenge after summer vacations!
    I have created a variable in the universe: SELECT current date  as TODAY FROM SYSIBM.SYSDUMMY1. I Called it TODAY.
    Then I created a prompt in the query based on Date. In Prompt Properties I tagged for "Set Default Values" and I typed in TODAY.
    When I try to run the query I get the error message:  The date for the query filter based on 'Date' is invalid (WIS10704).
    What is wrong? What do I have to do differently?
    My goal is to have a default for Date that gives me today..
    Regards Silje

  • How to get all values in the range of select option into internal table?

    Hi,
    I need to capture all entries coming in the range of select option into one internal table.
    How to do get that?
    For E.g
    select-options: matnr for mara-matnr.(select option)
    IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
    and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
    Regards,
    Mrunal

    Hello Mrunal Mhaskar  ,
    What i understand you can do one thing  go in debug mode
    Try this code : -
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-low IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-low.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-high IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-high.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    In the i_matnr table high and low values are there.
    Regards,
    Vandana.

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get the value from databank

    Hi,
    How to get the value from databank? and how to set the same value to visual script object?
    thanks,
    ra

    Hi,
    You can use GetDatabankValue(HeaderName, Value) to get the value from databank and SetDataBankValue(HeaderName, Value) to set the value to databank.
    You can refer to the API Reference to see list of associated functions and techniques we can use with related to Data Bank.
    This is the for OFT but if you are using Open Script then you have direct access for getting the databank value but when it comes to setting a value you have to use File operation and write you own methods to do the set operation.
    Thanks
    Edited by: Openscript User 100 on Nov 13, 2009 7:01 AM

  • How to get parameter value from report in event of value-request?

    Hi everyone,
    The customer want to use particular F4 help on report, but some input value before press enter key are not used in event of "at selection-screen on value-request for xxx", How to get parameter value in this event?
    many thanks!
    Jack

    You probably want to look at function module DYNP_VALUES_READ to allow you to read the values of the other screen fields during the F4 event... below is a simple demo of this - when you press F4 the value from the p_field is read and returned in the p_desc field.
    Jonathan
    report zlocal_jc_sdn_f4_value_read.
    parameters:
      p_field(10)           type c obligatory,  "field with F4
      p_desc(40)            type c lower case.
    at selection-screen output.
      perform lock_p_desc_field.
    at selection-screen on value-request for p_field.
      perform f4_field.
    *&      Form  f4_field
    form f4_field.
    *" Quick demo custom pick list...
      data:
        l_desc             like p_desc,
        l_dyname           like d020s-prog,
        l_dynumb           like d020s-dnum,
        ls_dynpfields      like dynpread,
        lt_dynpfields      like dynpread occurs 10.
      l_dynumb = sy-dynnr.
      l_dyname = sy-repid.
    *" Read screen value of P_FIELD
      ls_dynpfields-fieldname  = 'P_FIELD'.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_READ'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 1.
      check sy-subrc is initial.
    *" See what user typed in P_FIELD:
      read table lt_dynpfields into ls_dynpfields
        with key fieldname = 'P_FIELD'.
    *" normally you would then build your own search list
    *" based on value of P_FIELD and call F4IF_INT_TABLE_VALUE_REQUEST
    *" but this is just a demo of writing back to the screen...
    *" so just put the value from p_field into P_DESC plus some text...
      concatenate 'This is a description for' ls_dynpfields-fieldvalue
        into l_desc separated by space.
    *" Pop a variable value back into screen
      clear: ls_dynpfields.
      ls_dynpfields-fieldname  = 'P_DESC'.
      ls_dynpfields-fieldvalue = l_desc.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 0.
    endform.                                                    "f4_field
    *&      Form  lock_p_desc_field
    form lock_p_desc_field.
    *" Make P_DESC into a display field
      loop at screen.
        if screen-name = 'P_DESC'.
          screen-input = '0'.
          modify screen.
          exit.
        endif.
      endloop.
    endform.                    "lock_p_desc_field

  • How to get the values from repeated frame?.

    Hi
    how to get the values from repeated frame?. i have to disply the first 3 digits in another place in my report.
    i have field empno in repeated frame and i want to disply first 3 digits in another place in the same report.
    thanks

    How often do you need to display it? It sounds like you might want to base a summary on that formula with a function of first or last. If it's a per page basis, it can be a page level summary. If it's at a higher level repeating frame, then you can create the summary at that level. I'd suggest taking a look at the online help for summaries using the first/last functions.
    Hope that helps,
    Toby

  • How to get  the values of bdcmsgcoll to be printed in report

    hi experts,
    I am updating Va02 using BDc .. this is done however  i m struck at this point..
    I want to display the log i.e  messages  like data was updated ,, or any error ...
    As far as i know these logs are stored in BDcmsgcoll but how to get these value to be
    displayed in report once the update is done ..
    please help..if any body has any code .. then do send it to me.
    Thanks in Advance
    Srinivas

    Srinivas,
    data: messtab type table of BDCMSGCOLL with header line.
    Call transaction 'SM50' using bdcdata
                                  mode 'N'
                                  <b>messages in messtab</b>.
    Loop at messtab .
      write : messtab
    endloop.
    Pls. reward if useful

  • How to get the values of Select-options from the screen.

    The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

    Hi,
    Refer this following code..this will solve your problem...
    "Following code reads value entered in s_po select options and willprovide search
    "help for s_item depending upon s_po value.
    REPORT TEST.
    TABLES : ekpo.
    DATA: BEGIN OF itab OCCURS 0,
    ebelp LIKE ekpo-ebelp,
    END OF itab.
    SELECT-OPTIONS   s_po FOR ekpo-ebeln.
    SELECT-OPTIONS s_item FOR ekpo-ebelp.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
      DATA:
      dyn_field TYPE dynpread,
      temp_fields TYPE TABLE OF dynpread,
      zlv_dynpro TYPE syst-repid.
      zlv_dynpro = syst-repid.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = zlv_dynpro
          dynumb     = syst-dynnr
          request    = 'A'
        TABLES
          dynpfields = temp_fields
        EXCEPTIONS
          OTHERS     = 0.
      LOOP AT temp_fields INTO dyn_field.
        IF dyn_field-fieldname EQ 'S_PO-LOW'.
            SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
            WHERE ebeln EQ dyn_field-fieldvalue.
            EXIT.
        ENDIF.
      ENDLOOP.

  • How to get Distinct Values from Answers

    Hi,
    How to get Distinct values from answers, i've tried to put some functions on it.
    Thanks,
    Malli

    Malli,
    Are you trying to fetch data from Dimension Attr OR Fact Measures? Did you try the advance tab - > Advanced SQL Clauses - > Check this box to issue an explicit Select Distinct.

  • How to get a value for Select One Choice in the backing bean

    Friends,
    Does any one have any idea, how to get the value of a selected item value from the Select One Choice component in the backing bean iin valueChangeListener method. Right now I am always getting the sequence of the selected item, instead the actual selected value. I tried using 'ValuePassTrhough=true' also.. but didn't help
    Below is the my code snippet
    <af:selectOneChoice value="#{bindings.country.inputValue}"
    required="#{bindings.country.hints.mandatory}"
    shortDesc="#{bindings.country.hints.tooltip}"
    id="soc1" autoSubmit="true" valuePassThru="true"
    valueChangeListener="#{pageFlowScope.Bean.onValueChange
    <f:selectItems value="#{bindings.country.items}" id="si2"/>
    </af:selectOneChoice>
    Thanks in advance.

    check my other post at Re: Pass data from a variable to another page

  • How to get these values?

    This sample output of trcsess shows the consolidation of traces for a particular
    session. In the following example the session index and serial number equals 21.2371.
    trcsess session=21.2371My question is: what are session index and serial number here? How to get these values?

    As per the tuning doc:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#i20110
    You get these values from the V$SESSION view.
    Session Index = SID
    Serial number = SERIAL#

  • How do I change the default "date range" when searching in the forums?

    Hi all,
    New to the SAP forums...  How do I change the default date range when searching in the forums?  I am getting a 90 day search by default.  Then I have to change it and search again.  Argh!
    Thanks,
    --Amy Smith

    Hi Amy,
    the default date range cannot be changed by users. It is defined system-wide.
    Regards,
    Michael

Maybe you are looking for

  • Negative Stock in MB5B

    Hii, When i execute the mb5b for stock on posting date system is showing the negative stock. For Eg: Stock of one material is showing me as -50 No's as on Posting date 10.02.2008 In MB51 GR 101 for 100 No's on 29.02.2008 with Entry date: 29.02.2008 G

  • How to get File created Date

    Hi.. I need to get the file deleted date. Based on that i ve to remove those files which dates are less than 2004dec31. i can use fobj.delete(), for deleting the file. But how can i get the file created date? Regards KC.

  • Urgently in need of converting arabic PDF to word

    Does the latest adobe professional pdf reader recognise arabic script for conversion? A question has been answered related to this from 2012 but its 2015 now so wondering if there has been any progress in that regard. Thanks. If someone who's adobe-e

  • Need help troubleshooting slow startup after installing apps

    I'm relatively new to OSX (though not new to computer administration and Unix/Linux) and I need some guidance troubleshooting my slow booting Macbook. I've got a vanilla Macbook that can installed with 10.5.5 and I've since done the upgrade to 10.5.6

  • I can't hear music through 'Music' app on my iPhone after IOS7 - but I can hear YouTube and Italk?  Help

    After upgrading to IOS7 I can't hear my music in the "Music" app either through my head phones or through my phone - I can hear it in YouTube and iTalk or videos that I view online... Does anyone know why??? Thanks.