How to get the max. and min. of a selection-option?

hi experters
I wonder if there is any way can fetch the max value and minimum value from a select-option?
please hint, many thanks
wanlei.sun

a®s wrote:
> Try this way
>
>
> SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
>
> START-OF-SELECTION.
> SELECT * FROM T001W INTO IT_T001W
>        WHERE WERKS IN S_WERKS.
>
> SORT IT_T001W BY WERKS ASCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MIN. " MIN Value
>
> SORT IT_T001W BY WERKS DESCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MAX. " MAx Value
>
>
> a®s
Please try this.
TABLES : t001w.
SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
data: lv_min type T001W-WERKS,
      lv_max type T001W-WERKS,
      lv_count type i.
START-OF-SELECTION.
  sort s_werks by low.
  describe TABLE s_werks LINES lv_count.
  if lv_count = 1.
    lv_min = s_werks-low.
    lv_max = s_werks-high.
  elseif lv_count > 1.
    read TABLE s_werks index 1.
    lv_min = s_werks-low.
    if not s_werks-high is INITIAL.
      lv_max = s_werks-high.
    endif.
    READ TABLE s_werks INDEX lv_count.
    if lv_max is INITIAL.
      lv_max = s_werks-low.
    else.
      if lv_max < s_werks-low.
        lv_max = s_werks-low.
      endif.
    endif.
  endif.
  write :/ lv_min,
           lv_max.

Similar Messages

  • Query Designer in BI - How to cumulate value and get the Max and Min value.

    I want to create a report with  query designe of BI 7r. is it possible. the data from the cube will be
    Year ,           Exposed Quantity
    1999 ,             200
    2000 ,            100
    2001 ,            -100
    2002 ,             300
    2003 ,           - 200
    2004 ,             100
    2005 ,            -200
    Calculation should be - Refer the cumulative value field
    Year  ,          Exposure Quantity ,   Cumulative value
    1999  ,            200   ,                             200
    2000  ,            100  ,                              300
    2001  ,           -100 ,                               200
    2002  ,            300  ,                              500
    2003  ,          - 200  ,                              300
    2004  ,            100  ,                              400
    2005  ,           -200  ,                              -200
    An the out put of the report  should be Max value ie 500 and Min Value -200.
    My question is that is it possible to do in the front end ie in the Query Designer (BI 7) If so how.
    Edited by: Parakadavil Chacko Mathew on Oct 8, 2009 3:52 AM

    Hi there,
    Create 4 column,
    1st will show regular values for the key figure,
    2nd will show Cumulative value, in Query Designer, Just right click on the this 2nd key figure properties, calculation tab there you can check on Cumulated option, and define the calculation direction as Calculate along the Column.
    3rd will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as minimum.
    4th will show Minimum value , Just right click on the this 2nd key figure properties, calculation tab calculate single valuea as Maximum.
    Regards,
    Rajdeep Rane.

  • How to get the max value of a set of percentage values?

    Hi,
    I've tried to get the max and min value of a set of calculated percentage values. Such as
    Jan Feb March Apr May Jun    Min  Average   Max
    0,5 0,8  1,1      0,4 1      0,6     0,4   0,7         1,1
    The average value works fine. But with "min" and "max" I have a problem.
    I've tried to get the value with the following ways:
    - Create a new calc. keyfigure and make a sum of all values: (Jan + Feb + ...) and set the calculation in key figure properties to Min/Max.
    - Create a new calc. keyfigure and make a sum of all values and set the aggregation to Min/Max
    - Create a selected keyfigure with a filter to the necessary periods and set a calculation to Min (Aggregation is not possible here)
    - Create a new cal. keyfigure with all periods and the function Min. e.g. min(Jan, (min Feb, (min (....)
    None of this solutions provides the right min and max value. When I use an amount value (e.g. Euro) instead of these percentage values the keyfigure with the min and max function works. The others all provide wrong values.
    Is there a solution to get the right min and max value???
    It would be a great help when you have any hints.
    Thanks
    Claudia

    Hi Aduri,
    thanks for your answer but your solution doesn't work.
    The problem is that the periods are defined in a structure with offsets such as
    - period-11
    - period-10
    - period
    in this structure elements there is also the keyfigure "netvalue" defined.
    In the rows of the report there is another characteristic such as company code.
    Is there a solution to find the max and min values of the period values for each company code? Or must I change the data model e.g. copy the keyfigure and make a new keyfigure with another aggregation level?
    Thanks for any hints!
    Claudia

  • How can i write max and min data online during acquisition

    Hello,
    I am not keen with programming and your help will be greatly appreciated.
    I make temperature acquisition from an IR camera and I record online 38 different spots at a frequency of 10 samples/min.
    I also record two temperatures from thermocouples at the same sampling rate.
    I would like to make the acquisition during 5 sec every 20 sec and extract the max and min temperature from the thermocouples and write these values in a text file like show below :
    Temp_max 5 sec 22.1
    Temp_min 5 sec 2.1
    Temp_max 10 sec 42.1
    Temp_min 10 sec 4.1
    Temp_max 15 sec 82.1
    Temp_min 15 sec 6.1
    I also would like to make the same with two or three different spots of the IR camera. I think that if I have a good solution for the thermocouple, I can make it for the camera.
    I use LabView 8.2 with NIDaqmx acquisition.
    Thank you in advance

    Hello Evrem,
    Thank you for your advice. In fact, I have already attended to the training course you mentioned. I should think about going to the module Basic II. I do not have problem to connect/pilot various type of instruments but I am not very efficient with loop and arrays !
    I am fine with the data acquisition and the timing and I can sort data during 5 sec with "Array max & min". Then, I can display all data. What I have problem to do is to extract the max & min from the array, keep these 2 values for being writtten in a file at the end of my loop and start again during the next 5-sec cycle. At present, I only have the last max & min results from the last acquisition !
    Any example of how recording max & min online during 5-sec cycle acquisition will be welcome.
    Best regards,
    Labdummy

  • I have an Apple I Phone 4S which is great but, can someone help me how to get the photos and videos to my PC which runs on MS XP. I would like to be able to edit and copy to a DVD.

    I have an Apple I Phone 4S which is great but, can someone help me how to get the photos and videos to my PC which runs on MS XP. I would like to be able to edit and copy photos and videos to a DVD.

    Connect your iPhone to your computer. Tp your pc should recognize your iPhone as a camera. Use what ever application you have on the pc to transfer files from a camera to your computer.

  • How to get the number and response time of HTTP request through Weblogic?

    hi,
    does anybody know how to get the HTTP request information through Weblogic server, such as the number of HTTP request in 1 min and the average response time of request in 5 mins ?
    Or is there anyway i can do it through monitoring and get these data then? If so, please help tell me.
    Thanks in advance
    BTW, we don't have the 3rd-party monitoring tool here.

    Hi,
    tables: usr02, usr41.
    data: OPCODE_MODE_COUNT(1) TYPE X VALUE 3,
          modes like sy-index,
          u_MODES LIKE MODES.
    select * from usr02.
      select * from usr41 where BNAME = usr02-bname.
        CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_MODE_COUNT
          ID 'TID' FIELD usr41-TERMID
          ID 'MODES' FIELD MODES.
        IF SY-SUBRC = 0.
          u_MODES = u_MODES + MODES.
        ENDIF.
      endselect.
      if sy-subrc = 0.
        write:/ usr02-bname, u_MODES.
      endif.
      clear u_modes.
    endselect.

  • How to get the max(level)?

    Hi,
    The below query returns level and other selected columns.
    I need to get the max(level) 2nd column value in the below example.How to modify the query?
    Ex
    Level      max(level)     id
    1 5 101
    1 5 102
    1 5 103
    2 5 104
    2 5 105
    3 5 107
    4 5 120
    5 5 134
    5 5 280
    SELECT DISTINCT level lvl
    ,form_frms.emp_id
    ,form_frms.ing_emp_id
    ,form_frms.prve_id
    ,CASE
    WHEN (select div_dn
    from epm_prod epm
    where epm.emp_id= form_frms.ing_emp_id) ='Y' THEN DIV_DN
    WHEN NVL((select distinct 'N'
    from emp_pro_version prvv
    where prvv.is_py='Y' and
    prvv.IS_VERSION ='N' and
    prvv.emp_id=form_frms.ing_emp_id) ,'Y')='N'
    THEN 'Y'
    WHEN NVL((select distinct 'Y'
    from employee epm
    where emp.emp_id=form_frms.ing_emp_id
    and epm.status<>'NEW') ,'N') ='Y'
    THEN 'Y'
    ELSE 'N'
    END
    ELSE 'N'
    END UN_KNOWN_ID
    FROM (SELECT empvv1.prvv_id
    FROM emp_view_version empvv1
    WHERE empvv1.is_version = 'Y'
    ) form_frms
    START WITH form_frms.emp_id = :lv_emp_id
    CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
    ORDER BY level DESC, form_frms.emp_id,UNKNOWN_ID ASC;
    Edited by: shivasha on Feb 9, 2013 12:24 AM

    Maybe
    select lvl,
           max(lvl) over (order by null rows between unbounded preceding and unbounded following) max_level,
           emp_id,
           unknown_id
      from (SELECT DISTINCT
                   level lvl,
                   form_frms.emp_id,
                   form_frms.ing_emp_id,
                   form_frms.prve_id,
                   CASE WHEN (select div_dn
                                from epm_prod epm
                               where epm.emp_id = form_frms.ing_emp_id
                             ) = 'Y'
                        THEN DIV_DN
                        WHEN NVL((select distinct 'N'
                                    from emp_pro_version prvv
                                   where prvv.is_py = 'Y'
                                     and prvv.IS_VERSION = 'N'
                                     and prvv.emp_id=form_frms.ing_emp_id
                                 ),'Y'
                                ) = 'N'
                        THEN 'Y'
                        WHEN NVL((select distinct 'Y'
                                    from employee epm
                                   where emp.emp_id = form_frms.ing_emp_id
                                     and epm.status != 'NEW'
                                 ),'N'
                                ) = 'Y'
                        THEN 'Y'
                        ELSE 'N'
                   END UNKNOWN_ID
              FROM (SELECT empvv1.prvv_id
                      FROM emp_view_version empvv1
                     WHERE empvv1.is_version = 'Y'
                   ) form_frms
             START WITH form_frms.emp_id = :lv_emp_id
             CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
    ORDER BY lvl DESC,emp_id,UNKNOWN_IDRegards
    Etbin

  • How to get the lock and block occured for the full day

    Hi,
         How to monitor the lock and blocks occurred for the full day? i need to get it by end of the day. is there any script for this?

    Hi,
         How to monitor the lock and blocks occurred for the full day? i need to get it by end of the day. is there any script for this?
    Why would you like to collect information about locks and let me tell you, you cannot collect information about ALL locks which were taken and even thinking about it is pointless.
    Coming to blocking if you have heavy system with huge concurrency there is bound to be blocking which is necessary and good for RDBMS but if the blocking remains for long time then this is a issue.
    There is DMV sys.dm_tran_locks which tell you what all locks are being taken. You can see various examples mentioned in DMV online documentation and can schedule the query to run every 5
    mins and insert its record in table which you can refer at end of the day.
    This task would be made very easy if you have Monitoring tool which gives you information in your mail every time blocking occurs I have Spotlight in my environment.
    If you are looking for doc for troubleshooting blocking  below is one you can refer
    http://support.microsoft.com/kb/224453
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How to get the values and attributes of Longlived processes by using ProcessID.

    Hi Experts,
    For  every process we creates, LC ES2 creates processID.
    we know that if you creates  a long lived process, all  the  values which are in proces will be stored some where  in DB.
    Here my requirement is by using  processID I need to get all/some values/variables stored in database.
    I am not able to get values using processID. Here I don't have clue on  how to get the values.
    Please tell me  how to get the same by using  Process Management. Link/guide would be helpful
    Thanks
    Praveen.

    Searchable means you can put a filter criteria on it (e.g. where amount > 50000)
    Visible means you can add have this column returned as an output (and therefore you can add it as column in listview and see it in Task Details).
    These two attributes were provided so that queries could be done against the process variables, but the exact contents of the variables are not allowed to be seen.

  • How to get the recipient and Note for recipient in Medium 7 Simple Mail?

    Dear friends,
    I'm trying to send the shipment in the form of PDF attachment to the assigned user. I'm wondering how can I get the receiver and the note(which should be the content of the email) which can be configured in the "Communication Method"?
    Thanks,
    YiNing

    Well, the maintained text doens't  show up as the text of the mail content. So I'm actually asking how can I (from which variant in program) I can get this text. Or is there any standard program shows me how to do this?
    Thanks!

  • How to get the table_name and its count(*) in a SQL

    Hi,
    Can anybody tell me how to write a sql to get the table_name and its count(*) in a SQL:
    Output should be:
    table_name count(*)
    XXX 261723
    YYY 3343
    Regards,
    G. Rajakumar.

    hello
    there r a lot ways
    i'll suggest u two of them
    1) the following dynamic sql procedure
    DECLARE
    TYPE array_type IS TABLE OF VARCHAR(30);
    TYPE cur_typ IS REF CURSOR;
    c1 cur_typ;
    count1 integer;
    tab_arr array_type;
    querystr varchar2(200);
    begin
    SELECT table_name bulk collect into tab_arr FROM sys.all_all_tables ;
    FOR I IN tab_arr.first..tab_arr.last LOOP
    DBMS_OUTPUT.PUT(TAB_ARR(I));
    querystr := 'select count(*) from ' ||TAB_ARR(I);
    open c1 for querystr;
    fetch c1 into count1;
    EXIT WHEN c1%NOTFOUND;
    dbms_output.put_line(count1);
    END LOOP;
    close c1;
    END;
    2) or use ANALYZE to analyze the tables and get the number of rows in the NUM_ROW column of DBA_TABLES view.
    if u still have any problem mail me at [email protected]
    shalini

  • How to get the private and public key?

    there is my code,i want to get the public key and the private key �Cbut i could not find the the approprite method to solve the problem.
    import java.security.Key;
    import javax.crypto.Cipher;
    import java.security.KeyPairGenerator;
    import java.security.KeyPair;
    import java.security.Security;
    public class PublicExample {
    public static void main(String[] args) throws Exception {
    if (args.length != 1) {
    System.err.println("Usage:java PublicExample <text>");
    System.exit(1);
    byte[] plainText = args[0].getBytes("UTF8");
    System.out.println("\nStart generating RSA key");
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
    keyGen.initialize(512);
    KeyPair key = keyGen.generateKeyPair();
    System.out.println("Finish generating RSA key");
    Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", "BC");
    //System.out.println("\n" + cipher.getProvider().getInfo());
    System.out.println("\nStart encryption");
    cipher.init(Cipher.ENCRYPT_MODE, key.getPublic());
    byte[] cipherText = cipher.doFinal(plainText);
    System.out.println("Finish encryption:");
    System.out.println(new String(cipherText, "UTF8"));
    System.out.println("\nStart decryption");
    cipher.init(Cipher.DECRYPT_MODE, key.getPrivate());
    /*i want to get the private and public key in this method ,but i found the result was not
    the one i expected to get,how to solve the problem?
    thanks in advance!
    System.out.println("private key:" + key.getPrivate().toString());
    System.out.println("public key:" + key.getPublic().toString());
    byte[] newPlainText = cipher.doFinal(cipherText);
    System.out.println("Finish decryption:");
    System.out.println(new String(newPlainText, "UTF8"));
    thanks in advance!

    System.out.println("private key:" +
    " + key.getPrivate().toString());
    System.out.println("public key:" +
    + key.getPublic().toString());
    key.getPrivate() returns an instance of PrivateKey and key.getPublic() returns an instance of PublicKey. Since PublicKey and PrivateKey are interfaces then they will return one of the concrete implementations. Check out the Javadoc for PublicKey and PrivateKey.
    When you know which concreate implemenation you have then you can use the methods on that object (by appropriate casting) to find the information you want.

  • How to get the Folders and subfolders collection in Project Manager

    Hi,
    I am trying to get the folders and subfolders collection in Project Manager, so that I will be able to loop through the collection and be able to create a project under the appropriate folder.
    Any suggestions?
    Thanks.
    Bhanu

    Anything you do without submitting to form has to be done on the client side (ususally by JavaScript) using data which has been send already from the server.
    With JavaScript you can do quite a bit. You can download tables which don't necessarilly appear on the screen, loading them into JavaScript arrays by dynamically generating javascript. Then you can pick up events like drop-box selection and use these tables to chose what you do next (e.g. preloading other fields, setting drop box content etc.).
    Or, you can cause forms to be submitted when actions like a selection happen without the user clicking a button. It's generally a matter of how much data you'd need to transmit.
    Another posibility is to use a Java applet, which can generate requests to the server and handle the results as it chooses. That are a number of problems with that but occasionally it's the best solution.
    What you can't do is to handle user input inside a JSP. The JSP has come and gone before the user even gets to see your form.

  • How to get the constraintlist and column name in a table?

    Hi,
    can anyone please tell me how to get the constraint type ,and it's imposed on columns names in a table.
    Thanks,
    Deekay

    Deekay wrote:
    can anyone please tell me how to get the constraint type ,and it's imposed on columns names in a table.To get constraint type:
    select constraint_type from user_constraints where constraint_name = 'YOUR CONSTRAINT NAME';To get constraint columns:
    SELECT column_name from user_cons_columns where constraint_name = 'YOUR CONSTRAINT NAME';SY.

  • How to get the max record

    how to get the record with the max sequence no
    table as
    seq student mark
    1 A 10
    2 A 15
    1 B 20
    2 B 10
    1 C 30
    here is what i need
    seq student mark
    2 A 15
    2 B 10
    1 C 30

    i have used your query + some decode
    With t As
    Select 'A' st, 'X' Type,    1 seq,   001 marker_no, 10 mark From dual Union All
    Select 'A', 'X',    2,   001,       12 From dual Union All
    Select 'B', 'X',    1,   002,       10 From dual Union All
    Select 'B', 'X',    2,   003,       12 From dual Union All
    Select 'B', 'X',    3,   003,       15 From dual Union All
    Select 'C', 'X',    1,   001,       10 From dual Union All
    Select 'C', 'X',    2,   002,       15 From dual Union All
    Select 'C', 'Y',    3,   001,       20 From dual Union All
    Select 'C', 'Y',    4,   001,       10 From dual
    Select st,
           Sum (x_cnt) x_cnt,
           Max (x_seq) Keep (dense_rank Last Order By  x_seq) x_seq,
           max(x_marker_no) keep(dense_rank last order by x_seq) x_marker_no,
           max(x_mark) keep(dense_rank last order by x_seq) x_mark,
           sum(y_cnt) y_cnt,
           max(y_seq) keep(dense_rank last order by y_seq) y_seq,
           max(y_marker_no) keep(dense_rank last order by y_seq) y_marker_no,
           max(y_mark) keep(dense_rank last order by y_seq) y_mark
    from
        (Select st,
               decode(Type ,'X',1,0) x_cnt,
               decode(type ,'X',seq,0) x_seq,
               decode(Type ,'X',marker_no,0) x_marker_no,
               decode(Type ,'X',mark,0) x_mark,
               decode(Type ,'Y',1,0) y_cnt,
               decode(Type ,'Y',seq,0) y_seq,
               decode(Type ,'Y',marker_no,0) y_marker_no,
               decode(Type ,'Y',mark,0) y_mark
          From t
    Group By st;     
    /*this is the output
    st X_cnt X_seq X_marker_no X_mark Y_cnt Y_seq Y_marker_no Y_mark
    A  2     2     001         12     0     null  null        null
    B  3     3     003         15     0     null  null        null
    C  2     2     002         15     2     4     001         10
    ST      X_CNT      X_SEQ X_MARKER_NO     X_MARK      Y_CNT      Y_SEQ Y_MARKER_NO     Y_MARK
    A           2          2           1         12          0          0           0          0
    B           3          3           3         15          0          0           0          0
    C           2          2           2         15          2          4           1         10

Maybe you are looking for

  • **#bsp timed out error in SRM 4.0**#

    Hi, In SRM 4.0, i am executing BSP application '/CCM/SRM_CSE' through transaction se80.While i try to execute the controller <b>'main.do'</b>, i am getting an error '<b>connection timed out'</b>. Please help me regarding this. Thanks and regards, Raj

  • Downloaded iTunes 7.7 - now macbook won't start. Help!

    Hi, I downloaded five or six updates from mac this morning - one of which was iTunes 7.7. I then got an error message saying that the download hadn't worked and the files had been sent to my trash. I then got a message asking me to restart the comput

  • QA32 UD - Disable screen fields UD code and Quality score in QA12 screen

    Hi, This is regarding the QM module , QA32 transaction , UD subscreen under Characteristics tab. I need to disable the UD Code and Quality score  screen field in QA12  in cases where the inspection lot  stocks are completly posted. How can I achieve

  • JWSC ant task  getting java.lang.NoSuchMethodError

    Hi all, I am trying to build a webservice with JWSC ant task in JDK 1.6 which uses JWS annotations and a few weblogic specific annotations. I am getting the following error while building it. However, when I build it from my IDE (eclipse) it works fi

  • Dump after creating new header text on sales order and invoice.

    Hello, We have created one header text on sales order and the same text for invoices, on VOTXN customizing. Testing the new text, system let us save the text fine, but later, if we display the text, system give us dump error. My question is, after tr