Sorting HashMap based on values

I need to sort a hashmap based on the values, but also need to keep the keys available for retrieving the values.
Example:
key value
1 c
2 a
3 b
Desired Result
2 a
3 b
1 c
Thanks for your help.

You can do this by getting all the Map.ENTRY values in a HashMap object then using a custom Comparator object to sort them by value.
like this:
HashMap hashMap =  // your HashMap
Set entrySet = hashMap.entrySet;
/* Now add them into a list and use the Collections
* class to sort them.
ArrayList list = new ArrayList();
list.addAll(entrySet);
Collections.sort(list, yourSpecialComparator);Hope this helps.

Similar Messages

  • Want to sort HashMap based on Values with duplicate values

    Hi. I have a requirement to sort the HashMap based on the values not on the keys. My HashMap contains the values which are duplicates. My program is some thing like this.
    Map m = new HashMap();
    m.put ("Gosling", new Integer(2000));
    m.put ("Joy", new Integer(2000));
    m.put ("Schwartz", new Integer(3000));
    m.put ("Bracha", new Integer(4000));
    m.put ("Gafter", new Integer(3000));
    still i need to sort HashMap based on the values. How can i do it. I want the output some like this.
    Gosling 2000
    joy 2000 (may be interchanged)
    Schwartz 3000
    Gafter 3000 (Same as above)
    Bracha 4000
    Thanks.

    I found syntactical problems with above mentioned code.
    Here is edited working version:
    * test sortMap
    public void testSortMap () {
         Map m = new HashMap();
         m.put ("IGGHHG", new Integer(232353453));
         m.put ("ASDF", new Integer(345555000));
         m.put ("DSF", new Integer(345555000));
         m.put ("XYZ", new Integer(45555555));
         m.put ("AAA", new Integer(0));
         ArrayList outputList = sortMap(m);
         int count = 0;
         count = outputList.size();
              while(count > 0) {
                   Map.Entry entry = (Map.Entry) outputList.get(--count);
                   System.out.print("Key:" + entry.getKey());
                   System.out.println("\tValue:" + entry.getValue());
    * This method will use Arrays.sort for sorting Map
    * @param map
    * @return outputList of Map.Entries
    public ArrayList sortMap(Map map) {
         ArrayList outputList = null;
         int count = 0;
         Set set = null;
         Map.Entry[] entries = null;
    //     Logic:
    //     get a set from Map
    //     Build a Map.Entry[] from set
    //     Sort the list using Arrays.sort
    // Add the sorted Map.Entries into arrayList and return
         set = (Set) map.entrySet();
         Iterator iterator = set.iterator();
         entries = new Map.Entry[set.size()];
         while(iterator.hasNext()) {
              entries[count++] = (Map.Entry) iterator.next();
    //     Sort the entries with your own comparator for the values:
         Arrays.sort(entries, new Comparator() {
         public int compareTo(Object lhs, Object rhs) {
         Map.Entry le = (Map.Entry)lhs;
         Map.Entry re = (Map.Entry)rhs;
         return ((Comparable)le.getValue()).compareTo((Comparable)re.getValue());
              public int compare(Object lhs, Object rhs) {
         Map.Entry le = (Map.Entry)lhs;
         Map.Entry re = (Map.Entry)rhs;
         return ((Comparable)le.getValue()).compareTo((Comparable)re.getValue());
              outputList = new ArrayList();
              for(int i = 0; i < entries.length; i++) {
                   outputList.add(entries);
         return outputList;
         }//End of sortMap

  • Sort column based on value

    Hi All,
    Query result gives ou put like in the following order
    CITY NAME
    CHENNI
    DELHI
    LONDON
    RIO DEGENERO
    How to get output in the following sort order
    LONDON
    CHENNAI
    DELHI
    RIO DEGENERO
    i dont want to hardcode the column values ..it will be great if i get option to genrate dynamically.
    Thanks!

    Hi,
    user601042 wrote:
    Hi All,
    Query result gives ou put like in the following order
    CITY NAME
    CHENNI
    DELHI
    LONDON
    RIO DEGENERO
    How to get output in the following sort order
    LONDON
    CHENNAI
    DELHI
    RIO DEGENERO
    i dont want to hardcode the column values ..it will be great if i get option to genrate dynamically.If the sort order isn't hard-coded, how do you get it?
    If you call a function to get the sort order, then just call the function in the ORDER BY clause:
    ORDER BY  sort_key (city_name)If the sort order is in a table, join to that table, so you can use the appropriate column
    FROM     table_x  x
    JOIN      cities   c  ON  c.city_name = x.city_name
    ORDER BY  c.sort_key
    user601042 wrote:... i want to display the following order in screen
    3 LONDON
    1 CHENNI
    2 DELHI
    4 RIO DEGENEROThe question is, how do you determine that order? I don't see anything obvious in the data itself.
    If you were sorting by the id, either ascending or descending, then 1 wouldn't come between 3 and 2.
    If you were sorting by alphabetic order, either ascending or descending, then 'CHENNI' wouldn't come between 'LONDON' and 'DELHI'.
    If you were sorting by the length of the name, either ascending or descending, then 'DELHI' (5 characters) wouldn't come between 'CHENNI' (6 CHARACTERS) and 'RIO DEGENERO' (12 characters).
    By what are you sorting? If you can explain it in English, then someone can help you code it in SQL.
    Edited by: Frank Kulash on Oct 17, 2012 2:40 PM

  • Sorting numbers based on value into arrays

    Hi ...
    I currently have a large list of numbers inside an array.. say from 0 to 400 000. They appear in order, but are unevenly spaced.
    Now I'd like to sort these numbers into arrays.
    I want to say: Put all numbers from 0 to 10 into newArray[0]. Put all numbers from 10 to 35 into newArray[1] ....
    In the end I need a two - dimensional array with numbers. Is this possible in LabView ? Can it be done in acceptable speed ?
    Thank you for your help   

    While I haven't figured out a way to do this efficiently, the attached
    shows a method of doing it number by number.  Perhaps the most
    efficient may be to insert Matlab code and use a sort function, or
    equivalent in c.
    To use this to sort multiple numbers, put inside a for loop and build up an array. (also see attached).
    Message Edited by Robert.Bedford on 09-19-2005 08:53 AM
    Attachments:
    single_number_sort.vi ‏18 KB
    array_sort.vi ‏21 KB

  • How to sort HashMap by values?

    ?

    You can create a TreeMap out of your HashMap using the values as the key. Just remember that the keys can not be duplicates.
    Bosun

  • F4 Help IN ALV (OOPs) based on value entered in Other colunm.

    Hi,
    I have developed a module pool using ALV GRID Display.
    i have two fields in it. and for the second field i should provide F4 help. and the list in the f4 help should be based on the value enterd in first column.
    below is my code.
    MODULE BPO_100 OUTPUT.
    DATA: LT_FCAT TYPE LVC_T_FCAT.
    DATA: ls_fcat    TYPE lvc_s_fcat.
    DATA: wa type t_znout.
    *DATA: it_kd1 LIKE zish_pm_cs_kd1fd OCCURS 0 WITH HEADER LINE.
    SELECT * FROM zish_pm_cs_kd1fd INTO TABLE it_kd1 WHERE einri = rnpa1-einri.
      IF sy-subrc = 0.
        SORT it_kd1 BY sno.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_kd1 COMPARING fieldname.
    LOOP AT it_kd1 into wa.
    clear wa-value.
    MODIFY it_kd1 FROM wa.
    ENDLOOP.
           ls_fcat-fieldname = 'FIELDNAME'.
           ls_fcat-scrtext_l = 'Field name'.
           ls_fcat-scrtext_m = 'Field name'.
           ls_fcat-scrtext_s = 'Field name'.
           ls_fcat-tabname   = '1'.
           ls_fcat-col_pos = '1'.
           ls_fcat-outputlen = 15.
           APPEND ls_fcat TO lt_fcat.
           ls_fcat-fieldname = 'VALUE'.
           ls_fcat-scrtext_l = 'Value'.
           ls_fcat-scrtext_m = 'Value'.
           ls_fcat-scrtext_s = 'Value'.
           ls_fcat-tabname   = '1'.
           ls_fcat-col_pos = '2'.
           ls_fcat-outputlen = 15.
           ls_fcat-edit = 'X'.
           ls_fcat-f4availabl = 'X'.
           APPEND ls_fcat TO lt_fcat.
    IF G_CUSTOM_CONTAINER1 IS INITIAL.
    create a custom container control for our ALV Control
        CREATE OBJECT g_custom_container1
            EXPORTING
                container_name = g_container1
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
            IF sy-subrc ne 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'ZISH_SCRN_ALV'
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
    create an instance of alv control
        CREATE OBJECT grid1
               EXPORTING i_parent = g_custom_container1.
      CALL METHOD grid1->set_table_for_first_display
               EXPORTING
                i_structure_name = 'ZISH_PA_ZNOUT'
          i_default        = gs_test_1700-vari_default
                 i_default        = 'X'
                i_save           = gs_test_1700-vari_save
                is_variant       = ls_vari
                is_layout        = gs_layout1
               CHANGING
                 it_outtab        = it_kd1
                 IT_FIELDCATALOG  = LT_FCAT.
    ENDIF.
    ENDMODULE.                 " BPO_100  OUTPUT
    Edited by: Guru Ram on Sep 24, 2009 8:58 AM

    See sample code.
    I have 2 fields  MATNR and DESC in screen 100. Change it according to ur needs.
    In screen flow logic,
    PROCESS ON VALUE-REQUEST.
      FIELD  desc MODULE module_desc. " F4 for screen field DESC based on value entered in field MATNR
    In report,
    MODULE module_desc INPUT.
      TABLES: ddshretval.
      DATA:  l_t_dynpread LIKE dynpread OCCURS 0 WITH HEADER LINE,
               l_t_dynpread1 LIKE dynpread OCCURS 0 WITH HEADER LINE.
      DATA: l_t_retdynr TYPE TABLE OF ddshretval,
              l_wa_retdynr LIKE LINE OF l_t_retdynr.
      DATA: BEGIN OF g_t_desc OCCURS 0,
            maktx TYPE makt-maktx,
            END OF g_t_desc,
            wa LIKE g_t_desc.
      l_t_dynpread-fieldname = 'MATNR'.  " Field1 name
      APPEND l_t_dynpread.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = '0100'
        TABLES
          dynpfields           = l_t_dynpread
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      READ TABLE l_t_dynpread INDEX 1.
      IF l_t_dynpread-fieldvalue IS NOT INITIAL.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'  " Converting matnr to 18 digits
    EXPORTING
    input = l_t_dynpread-fieldvalue
    IMPORTING
    output = l_t_dynpread-fieldvalue.
        SELECT maktx FROM makt INTO TABLE g_t_desc WHERE matnr = l_t_dynpread-fieldvalue.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
                EXPORTING
                  retfield        = 'MAKTX'
                  dynpprog        = sy-repid
                  dynpnr          = sy-dynnr
                  value_org       = 'S'
                TABLES
                  value_tab       = g_t_desc
                  return_tab      = l_t_retdynr
                EXCEPTIONS
                  parameter_error = 1
                  no_values_found = 2
                  OTHERS          = 3.
        READ TABLE l_t_retdynr INTO l_wa_retdynr INDEX 1.
        IF sy-subrc = 0.
          l_t_dynpread1-fieldname = l_wa_retdynr-fieldname.
          l_t_dynpread1-fieldvalue =  l_wa_retdynr-fieldval.
          APPEND l_t_dynpread1.
          l_t_dynpread1-fieldname = 'DESC'. " Field2 name
          APPEND l_t_dynpread1.
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname               = sy-repid
              dynumb               = sy-dynnr
            TABLES
              dynpfields           = l_t_dynpread1
            EXCEPTIONS
              invalid_abapworkarea = 1
              invalid_dynprofield  = 2
              invalid_dynproname   = 3
              invalid_dynpronummer = 4
              invalid_request      = 5
              no_fielddescription  = 6
              undefind_error       = 7
              OTHERS               = 8.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " module_desc  INPUT
    Thanks.

  • Sorting the list of value like in BEX but out of crystal report

    All,
    I have created a crystal report base on a BEX query where I have a variable for which  i am filtering base on a field period.fiscalyear.
    for the list of values that prompt you for this variable ...
    l in BEX we can do the sort by either alphabetical ascending order or descending alphabetical order such as:
    here is for ascending
    001.2008
    001.2009
    or by clicking on it we can do the following: (descending)
    012.2009
    012.2009
    however in crystal when refreshing the report in infoview it sorts the list of value base on the month
    something like this :
    JAN 2008 [0FISCPER].[K42008001]
    FEB 2008 [0FISCPER].[K42008002]
    We would like to have in crystal the same behaviour than in BEX,  so in crystal we would like to be able to get the list of values sorted in either ascending order to descending order. is there a way to do so ?
    notes also that we would like to avoid to create the variable in crystal
    Philippe

    Hi,
    in Crystal Reports you have per InfoObject - depending on the definition - the key value, the description and the member unique name. In BW these objects are defined as NUMC in most cases - which means it is a character / string.
    In your example the value is 001.2008 and 001.2009. What you can do in Crystal Reports is to split up the values into year and month and then sort based on the actual numbers.
    Ingo

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • N9 Photo Gallery sort order - based on what?

    Hello,
    I am thrilled with my N9, but have one problem: I want to use the phone to keep not only photos made with it. I therefore saved extra photos in the Pictures folder. They appear in the gallery, but in a weird order, not based on either the name, EXIF date, modification date or creation date. Is there a possibility to sort them on either of these? All I want is to control the sort order. After all, it is MY gallery...
    On my previous phone (N8) sorting was based on the last modification date. Also not optimal (EXIF date would have been perfect) but still controllable.
    Solved!
    Go to Solution.

    Well, maybe those pictures were never edited outside the phone, I don't know.
    Anyway, I believe I found the explanation: I exported the photos from Picasa, maxing them to a resolution of 1600xXXX. This way all files were created... today. Nevertheless the EXIF information is correctly saved by Picasa, so Date Image Taken was preserved. Although I modified in all files the creation date to be equal to EXIF Date Image Taken (ACDSee/batch/AdjustTimeStamp) , and then also renamed all pictures based on that, the "new" creation date still remains saved somewhere in the picture files and the Gallery sorts the pictures on it! The pictures were sorted in the reversed order I exported them from Picasa... Bad.
    Anyway, since this is not a request forum, it would be futile to say (again) that Nokia should use the EXIF Date Picture Taken for picture sorting. So I don't say it (!).

  • Populate f4 values of a field based on value of other field

    Hi,
    I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
    How will i achceive this requirement.
    I got a link about the same but that is not using WDR_SELECT_OPTIONS
    http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
    I got another link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    which I am going to try
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AM

    Hi,
    Using OVS you can achieve this.,  In OVS Event Handler read the value based on which you  want to display F4 for other field and populate the values based on the first field.
    this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • How to generate controls dynamically based on value stored in database using mvc4?

    In my database, i have a field called control_ids corresponding to  text box, dropdownlist, radiobuttonlist etc. My goal is to
    create controls dynamically based on value of control_id-field in table. Anybody please help me how to create the controls dynamically in MVC 4 for this scenario.

    In your view you could do something like that:
    foreach (var field in Model.FormStruture.fields)
    <div class="editor-label">
    <label for="@field.Name">@field.Descricao</label>
    </div>
    <div class="editor-field">
    <input class="text-box single-line" id="@field.Name" name="@field.Name" type="text" value="@field.Valor" data-rules-required="@field.Mandatory.ToString().ToLower()" data-rule-number="@field.Tipo.Equals(SiB.OCR.Documentos.Modelo.TipofieldDocumento.Numerico).ToString().ToLower()" title="@field.Descricao" />
    </div>
    if (!String.IsNullOrEmpty(field.Format))
    @:<script type="text/javascript">$("[email protected]").mask("@field.Format");</script>

  • Calculate BED & relevant duties based on value @ PO for a particular vendor

    Dear experts,
    Is it possible to calculate excise duties and other relevant pricing elements at purchase order level based on VALUE and capture the same (part1 - MIGO and part11-J1IEX) for a PARTICULAR VENDOR INVOICE?
    The business process is like this. First we r receiving invoice from vendor and based on that we r creating PO and do other transaction activities.
    We r using ECC6.we r maintaining tax details through tax codes based on percentage and pricing procedure(TAXINJ) is activated and pricing elements are managed through cond.types(gross is value base and others are managed by %).
    I find difficulty to capture excise data (cin) through % in j1iex and manual value adjustment is tedious process for multiple line items.
    If it is possible, kindly suggest.
    Regards,
    Vimalan.

    This is nothing but Trading process...
                u will not know what amount of excise the vendor is passing on u..
    just follow the below steps
    hi
    create material master with HAWA material type..
    maintain material chapter id combination in J1ID
    create tax code with zero excise and some vat/cst in FTXP
    maintain condition records for tax code in FV11
    Assign tax code to company code in tax on goods movement
    create PO in ME21N with the tax code created.
    During MIGO change the base amount
    Base amount = Base amount(PO) - Excise(bed, ecess, secess)
    enter the bed ecess secess in excise item details
    In excise header tab click on additional data (pencil icon) there in miscellaneous tab check mrp indicator
    post the document.
    in MIRO change the base amount to base amount - excise.
    During Purchase the RG23 A reg will Update..
    During Sales RG1 willl update..

  • Convert hashmap (containing null values) to hashtable

    hi
    the following code gives me java.lang.NullPointerException
    how can i convert a hashmap ( contaiing null values ) to hashtable... ??
    and vice versa ?
              HashMap hm =new HashMap();
              hm.put("1","one");
              hm.put("2","two");
              hm.put("3","three");
              hm.put("4",null);
              Hashtable ht = new Hashtable(hm);how ever the code will run perfectly well if i remove
                   hm.put("4",null);Regards
    Lav

    so does that mean that theres is no way to convert a
    hashmap containing null values to hashtable ..!!There are several ways described above.
    If you mean is there a way to preserve the nulls as nulls, then, no, you cannot do that, because, as stated in the docs, null cannot be a key or value in a Hashtable.

  • Populating values in dropdown based on values selected in second dropdown.

    Hi,
    I  have two listboxes on the screen. Based on value chosen in first dropdown, I want to populate the values to be selected in second dropdown. How can i achieve this? I would be glad if anyone can help me out with this requirement.
    Thanks,
    Ameet

    <font color=blue>Hi,
    <li> Place 2 input fields on screen.
    <li>Set Listbox property as it is shown in the below link.
         <a href="http://2.bp.blogspot.com/_O5f8iAlgdNQ/SmPSPnRa0tI/AAAAAAAAFCQ/wW_URP-ld6o/s1600-h/drop_down-770536.JPG" target="_new">link to dropdown setting</a>
    <li>Set function code to first dropdown box to trigger event when you select value from first dropdown box. So that second one is changed.
    <li>Declare variable like below in TOP include of the module pool program.
    <pre>DATA: g_drop_1 TYPE char10,
          g_drop_2 TYPE char10,
          ucomm    TYPE sy-ucomm.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.</pre>
    <li> Use screen flow logic of the screen like below
    <pre>"PROCESS BEFORE OUTPUT.
    PROCESS BEFORE OUTPUT.
    field g_drop_1 MODULE drop_down_1.
    field g_drop_2 MODULE drop_down_2.
    "PROCESS AFTER INPUT.
    PROCESS AFTER INPUT.
    field g_drop_1.
    field g_drop_2.</pre>
    <li>Corresponding code for two drop down boxes.
    <pre>&----
    *&      Module  DROP_DOWN_1  OUTPUT
    MODULE drop_down_1 OUTPUT.
      CLEAR: list[],g_drop_2.
      name = 'G_DROP_1'.
      value-key  = '1'.
      value-text = 'value_1'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '2'.
      value-text = 'value_2'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '3'.
      value-text = 'value_3'.
      APPEND value TO list.
      CLEAR  value.
      value-key  = '4'.
      value-text = 'value_4'.
      APPEND value TO list.
      CLEAR  value.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_1  OUTPUT
    *&      Module  DROP_DOWN_2  OUTPUT
    MODULE drop_down_2 OUTPUT.
      CLEAR list[].
      name = 'G_DROP_2'.
      CASE g_drop_1.
        WHEN 1 OR 2.
          value-key  = '1'.
          value-text = 'text1'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '2'.
          value-text = 'text2'.
          APPEND value TO list.
          CLEAR  value.
        WHEN 3 OR 4.
          value-key  = '3'.
          value-text = 'text3'.
          APPEND value TO list.
          CLEAR  value.
          value-key  = '4'.
          value-text = 'text4'.
          APPEND value TO list.
          CLEAR  value.
      ENDCASE.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = name
          values = list.
    ENDMODULE.                 " DROP_DOWN_2  OUTPUT</pre>
    Thanks
    Venkat.O</font>

  • XML Forms Builder: Sorting news based on a date field in a XML form

    Hi Experts
    I have a requirement and I am stuck up in finding a solution. I have a XML form and this has been mapped to a folder in KM. It publishes news. In the collection renderer settings there is an option to sort the news ascending or descending based on created/modified criteria.
    The requirement is to sort the news based on a date field in XML form. Can you experts help me in getting the solution for same?
    The users who post the news in our portal needs the information to be sorted based on a date field shown.
    Thank you
    Best regards
    Ramamoorthy D

    Hi Experts
    I have not got any solution for this issue. Can any of you get me some clue to work on this issue with sorting news based on a date field in a XML form?
    I removed the property link from the screen field Input field.
    Thank you
    Best Regards
    Ramamoorthy D

Maybe you are looking for

  • Launch a BI Publisher Report from ODI 11g

    Hello, I have a requirement where after a data load completes in ODI, a BI Publisher report should be launched which will email some pdf output to users. Is there a way in ODI that as the last step in the data load process, I can launch a BI Publishe

  • Cell border frustration

    Apologies in advance for the slightly ranty nature of this post. I am not new to this stuff but occasionally it seems I'm either missing something obvious or there are flaws in the RH GUI. Either way I have just wasted a load of time on something tha

  • Custom jQuery overlay tool in Interactive Reports not rendering

    As the subject says, I got a problem in rendering jQuery on an Interactive Report. It is working on a non-paginated pages, like forms, and also in Interactive Reports, but whenever the data is getting paginated, after you go to the next page, the jQu

  • How to concat columns from more than one record?

    I have a function that takes an Oracle long and returns it as a varchar so that I can use it in the Microsoft world. My problem is that the SELECT returns more than one row (which is valid) and I need the Long fields to be concatenated into the one v

  • When I click the dashboard, I get doubles

    Hi, This has been a problem for a while. When I click on the dashboard icon on my dock, I get doubles: 2 calculators; 2 weather panels; and 2 clocks. I do NOT get 2 calendars for some reason. (??) I've checked Dashboard Preferences and there seems to