Sorting in dropdownbykey

Hi,
I've manage to manually added list of values using svs in a for loop into a dropdown.  Is there a way the list in the dropdown display in a sorted way?
Thanks
Edited by: Shreya Eknath on Apr 23, 2009 12:38 PM

Hi,
Try this code:
IPrivateBsb.IBttlNode bttlNd =wdContext.nodeBttl();
        IWDAttributeInfo bttlList =wdContext.getNodeInfo().getAttribute("BttlDrop");
        ISimpleTypeModifiable bttlType = bttlList.getModifiableSimpleType();
        IModifiableSimpleValueSet valueSetBttl =bttlType.getSVServices().getModifiableSimpleValueSet();
        List tempList  = new ArrayList();
        for (int count = 0; count < bttlNd.size(); count++) {
             IPrivateBsb.IBttlElement bttlEmt = bttlNd.getBttllementAt(count);
             tempList.add(bttlEmt.getBttlName());
        Collections.sort(tempList);
                    // Also check these ways.....
         // Case-insensitive sort
                    // Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
                    // Reverse-order sort
                    //    Collections.sort(list, Collections.reverseOrder());
        int size = tempList.size();
        String name = null;
        for (int i = 0; i < size; i++) {
          name = (String)tempList.get(i);
          IPrivateBsb.IBttlElement bttlEmt = bttlNd.getBttllementAt(count);
          if(name.equalsIgnoreCase(bttlEmt.getBttlName())){
               valueSetBttl.put(bttlEmt.getBttlId(), name);
I hope this helps.. Please revert back in case u want further help.
Thanks and Regards
Pravesh

Similar Messages

  • Sorting of dynamical  created table

    Hi,
    i created a context node for a table uielement and added in wddoinit method some attributes.
    The celleditor vor according columns is a DropDownByKey .
    How can i sort my table by one of this dynamical attributes/columns ?

    Hi ,
          I would like to explain the code in more detail
    DATA: lv_slno type string value 'SLNO',  " SLNO is your column name by which you want to sort
               lo_node type ref to if_wd_context_node.
      FIELD-SYMBOLS :
        <lv_table>  TYPE STANDARD TABLE.
    Get the reference of your table node into lo_node
    lo_node = wd_context->get_child_node(  'ABC' ).  " Assuming ABC is the node name
    Get the data of the node
    lo_node->GET_STATIC_ATTRIBUTES_TABLE(
                                                        IMPORTING TABLE = <lv_table> ).
    Sort the data in the table
    SORT <lv_table> BY (lv_slno) DESCENDING.
    Bind the sorted data again 
    lo_node->bind_table( <lv_table> ).
    I hope it is clear now . Let me know in case of any confusion .
    Regards
    Vivek

  • Display dropdown by key data with sorting

    Hi,
    My requirement is to display dropdown by key data with sorting getting this data from XML in KM.
    Tell me different possibilities to sort the data.
    Regards,
    surya.

    Hi,
    Use DropDownByIndex instead of DropDownByKey
    Create a node with a attribute for eg. Colors node with Color attribute and add the values in the elements of the node, Bind attribute to DropDownByIndex UI.
    Create a custom comparator class like below
    import java.util.Comparator;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
    import com.sap.tc.webdynpro.progmodel.repository.enums.WDComponentLifecycleEnumInfo;
    public class CustomComparator implements Comparator {
         String attribute;
         public CustomComparator(String attrib) {
              this.attribute = attrib;
         public int compare(Object o1, Object o2) {
              try
                   IWDNodeElement units1 = (IWDNodeElement) o1;
                   IWDNodeElement units2 = (IWDNodeElement) o2;
                   return units1.getAttributeAsText(attribute).compareTo(units2.getAttributeAsText(attribute));
              catch (Exception e)
                   e.printStackTrace();
              //arbitrary order
              return 1;
    Once you read values in the Colors node, call the sortElements method of the node as below to sort the elements of the node
    wdContext.nodeColors().sortElements(new CustomComparator("Color"));
    Regards,
    Amol

  • How to sort 2 dropdown boxes with joined context?

    Hi Guys,
    I have 2 dropdown boxes that are lined to the same table context.
    I do the binding by using the one bind_table method.
    one DD is showing the Key while the other shows the description. They both have the same binding.
    once the user changes one, new data is selected and the drop downs show the key & description.
    What I want to do is to sort each list to be ordered. one by keys and the other by descriptions.
    How should I do that?
    thanks,
    Itay

    Hi,
    first,
    I would like to mention that there is no joined solution to what I asked here, which is different than what you ask...
    You have to make 2 context nodes if you want to sort the data different.
    in a drop down, you can't display 2 separate columns.
    The only thing you can do is to concatenate the key to the description, something like:
    CA - Canada
    US - USA
    FR - France
    if you need to present more than one column maybe it will be best to put a table and link it to some event...
    I "solved" this issue by putting 2 drop downs. I wanted to allow the user to select a value from a list and then to change the screen according to his selection.
    I did something like:
    Choose by key: <dropdownbykey - Key column>
    Choose by description: <dropdownbykey - Desc column>
    I hope this helps...
    Itay

  • In Photoshop Express, cannot sort images in album by filename in thumbnail view (for slideshow)l.

    In Photoshop Express, I want images to appear sorted by filename.  In the "view as a table" it sorts fine.  When I revert to the thumbnail view, the arrangement is random.  The dropdown "show" list does not offer an option for showing by filename.  If I select the"custom" option, it means I would need to sort 300 images by filename MANUALLY (!!!), a job that a computer does in milliseconds.  Anyone with a solution?  Thanks.

    fwiw, with my images in the 'Folder Location' view the photos are in order by their Windows filename. That is the same order as the hardcopy album the photos came from. So I then created a PSE Album. I selected all my photos and moved them into that album. The order of the pictures was retained in the Album. That worked out great. I wanted my PSE images to be in the same order. I thought I would do it with tags. But creating an album seems to work just fine.

  • Unable to capture the adf table column sort icons using open script tool

    Hi All,
    I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
    1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
    2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.

    Hi keerthi,
    1. I have pasted the code for the first issue
    web
                             .button(
                                       122,
                                       "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
                             .click();
                        adf
                        .table(
                                  "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
                        .columnSort("Ascending", "Name" );
         }

  • How to sort out different issues on Satellite A505-S6973

    Can anyone tell me, if the warranty period on my laptop has not passed, can i return my laptop to toshiba and have all my issues sorted out. Would there be a cost to do whatever repairs software related needs be done and how i am supposed to go about it because my laptop is beginning to have all sorts of little errors, i noticed that my harddrive has 156gb used although i have about 60 gigs in use.
    A couple multimedia buttons aren't working but i touch them, my touchpad doesn't turn off with the hard button unless i turn it off using the FN key and my processor runs low but when i use a program i see it's reaching between 85 to 100% utilization.
    I really like this laptop, but the issues i'm having i highly doubt it should operate this way.

    Hi mate
    Software issues are not covered by warranty!
    This means that you will have to pay for everything if the ASP technician would not find any problems!
    This is why you should recover the notebook in order to check if its only a software related issue.
    >A couple multimedia buttons aren't working but i touch them, my touchpad doesn't turn off with the hard button unless i turn it off using the FN key
    Reinstall the VAP (value added package) and flash cards utility
    >my processor runs low but when i use a program i see it's reaching between 85 to 100% utilization.
    This is not a bug or hardware problem. You will notice this CPU behavior because the CPU supports an feature which helps to save the power and reduce the heat dissipation

  • Issue With Page Break When Sorting is also applied on group

    Hi
    I am facing an issue with Page break only when I have sorting applied on the grouping that I have in the template.
    The following is the sample XML
    <ROWSET>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Accounts</ORGANIZATION>
    <FULL_NAME>test1,</FULL_NAME>
    <ELEMENT_NAME>TEST BONUS</ELEMENT_NAME>
    <CLASSIFICATION>Supplemental Earnings</CLASSIFICATION>
    <RUN_VALUE>250</RUN_VALUE>
    <MONTH_VALUE>500</MONTH_VALUE>
    <QUARTER_VALUE>500</QUARTER_VALUE>
    <YEAR_VALUE>500</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test2</FULL_NAME>
    <ELEMENT_NAME>VOLUNTARY AD AND D</ELEMENT_NAME>
    <CLASSIFICATION>Voluntary Deductions</CLASSIFICATION>
    <RUN_VALUE>5.19</RUN_VALUE>
    <MONTH_VALUE>10.38</MONTH_VALUE>
    <QUARTER_VALUE>10.38</QUARTER_VALUE>
    <YEAR_VALUE>10.38</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test3</FULL_NAME>
    <ELEMENT_NAME>HMO MEDICAL</ELEMENT_NAME>
    <CLASSIFICATION>Pre-Tax Deductions</CLASSIFICATION>
    <RUN_VALUE>19.67</RUN_VALUE>
    <MONTH_VALUE>39.34</MONTH_VALUE>
    <QUARTER_VALUE>39.34</QUARTER_VALUE>
    <YEAR_VALUE>39.34</YEAR_VALUE>
    </ROW>
    <ROW>
    <GRE>org1</GRE>
    <ORGANIZATION>Finance</ORGANIZATION>
    <FULL_NAME>test4</FULL_NAME>
    <ELEMENT_NAME>PENSION NR DC</ELEMENT_NAME>
    <CLASSIFICATION>Pre-Tax Deductions</CLASSIFICATION>
    <RUN_VALUE>0</RUN_VALUE>
    <MONTH_VALUE>360</MONTH_VALUE>
    <QUARTER_VALUE>360</QUARTER_VALUE>
    <YEAR_VALUE>360</YEAR_VALUE>
    </ROW>
    </ROWSET>
    In the template I group the data based on CLASSIFICATION and then sort on the same column CLASSIFICATION. I have a page-break applied for every group.
    When I generate the PDF, I am not getting the page-breaks for every group. Instead some of them are displayed in the same page.
    But when I remove the sorting that I had in the template on the column CLASSIFICATION, I am getting the output in the desired way but not in a sorted order.
    kumar

    Hi All,
    I am using MS-WORD 2007 and BI Publisher desktop 10.1.3.3.3.
    When I use split-by-page-break, splitting is performed for every line .. but not for group of lines.
    Can anybody throw some light on this?
    FYI...
    I am using this code:
    ?if: position() mod 6= 0?
    ?split-by-page-break:?
    ?end if?
    (Of course with in tags)
    in G_LINES loop.
    Can anybody help me out :-(
    --Saritha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • ALV .  How to remove the sort buttons on toolbar in ALV report?

    Hi,experts
      As you know, in default case , the alv report will display two sort buttons(ascending ,descending) on its toolbar , So How to remove the sort buttons on toolbar in ALV report?
      Thanks for your help .

    Hi guixin,
    1. Before calling REUSE_ALV_LIST_DISPLAY
    2. Write this code :
    data : excl type SLIS_T_EXTAB.
    data : exclwa type SLIS_EXTAB.
    exclwa = '&OUP'.
    append exclwa to excl.
    exclwa = '&ODN'.
    append exclwa to excl.
    3. Then while calling the FM,
       pass this parameter also .
    IT_EXCLUDING     = excl
    It will work fantastic.
    regards,
    amit m.

  • Field should not display in the subtotal row in ALV report after sorting .

    we have a requirement, after sorting and subtotaling, the output in ALV is -
    vbeln        amount1  amount2  amount3
    123           11              12            13
    123           12             13             14
    123           23             25             27 
    133           11              12            13
    133           12             13             14
    133           23             25             27
    Now the customer wants the ALV outpput in this fashion -
    123           11              12            13
    123           12             13             14
                     23             25             27    --->123 (vbeln) should not come in subtotaling row
    133           11              12            13
    133           12             13             14
                      23             25             27--->133(vbeln) should not come in subtotaling row

    Hi,
    if it helps you could create a hierachy. In this way you can define the field catalog for the lines and for the subtotal columns. The only thing is that you would always show the subtotal rows.
    You have references of hierachy alvs in
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
    ALV Hierarchy
    alv hierarchy
    In this case it also sorts
    Sorting for ALV hierarchy
    I hope it helps.
    Edited by: Oscar Pecharroman on Aug 2, 2010 1:13 PM

  • Sorting not working correctly for date field in alv report

    Hi All,
    My report displays many rows also containing date type fields of bldat,budat .
    When I sort the report selecting field of type bldat budat the sorting is not correct for the year.
    Ex:
    Invoice doc dat
    01-25-2011
    01-21-2011
    02-02-2011
    10-25-2010
    11-20-2010
    If I use ascending then it is sorted as :
    Invoice doc dat
    01-21-2011
    01-25-2011
    02-02-2011
    10-20-2010
    10-25-2010
    Why the sorting is not working correct for year.(2010 records should have been first).
    The field wa_tab-bldat is of type char10.
    It is populated as wa_tab-bldat = bsak-bldat.
    Kindly suggest what can be done.

    The field wa_tab-bldat is of type char10
    Then what it does is correct.
    Refer to type datum...it will work

  • Sort field in ALV report

    Hi Expert,
    IN  ALV report using RESUE_ALV_GRID_DISPLAY . I want to sort the second field of ALV output . In this function module  RESUE_ALV_GRID_DISPLAY  using event PF_STATUS . so can u tell me how sort the second field .
    Regards
    Bhabani

    Hi,
    check the fallowing code
    IT_SORT TYPE SLIS_T_SORTINFO_ALV,
    WA_SORT TYPE slis_sortinfo_alv,
    ****SORT LABELS AT RUN TIME
      WA_SORT-TABNAME = 'IT_FINAL1'.
      WA_SORT-FIELDNAME = 'BUDAT'.
      WA_SORT-UP = 'X'.
      WA_SORT-GROUP = 'X'.
    WA_SORT-subtot = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-TABNAME = 'IT_FINAL1'.
      WA_SORT-FIELDNAME = 'MATNR'.
      WA_SORT-UP = 'X'.
      WA_SORT-GROUP = 'X'.
    WA_SORT-subtot = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM               = SY-REPID
          I_CALLBACK_TOP_OF_PAGE           = 'TOP_OF_PAGE'
          IS_LAYOUT                        =  LAYOUT
          IT_FIELDCAT                      = IT_FIELDCAT
          IT_SORT                          = IT_SORT
          I_DEFAULT                        = 'X'
          I_SAVE                           = 'U'
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
         TABLES
           T_OUTTAB                        = IT_FINAL1
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards
    Nandan.N

  • Sorting in 6i and 10g reports

    Hello All,
    I am running 6i and 10g reports against a 10g database.
    I ran one of the 6i report and it generated a report in one sorting ordear
    and when i ran the same report on 10g ,it generated the report in ddifferent order.
    Both the reports r run against the same 10g database.
    The order by clause on the columns of the records r identical.
    Now i wanted to understand how it is sorting in different orders in both 6i and 10g reports?
    Thanks,
    Ranz

    Hi,
    Please note the fact that 6i Reports is not certified to work with 10g Database. Hence it becomes impossible to address the sorting behavior of 6i Reports, though there is nothing different in the way it works. I would suggest you to use 10gR2 version of Reports services with 10g Database which is certified and supported. Thanks for your understanding.
    Regards,
    Anand

  • Is there a way of making my iPod's "cover flow" sort in the same way the software can . Artist -- Album by Year . It only seems to do Artist -- by Alphabetical Album . I want it look like it does on the PC .

    Is there a way to make the "cover flow" on the iPod match the sort style that I use on the software . I go with Artist -- Album by Release Year . But the ipod seems to only do Artist -- Alphabetical by Album , and then there are a handful of albums oddly out of place . Can it be done ?

    Ottonomy, here's what to do.
    Connect your iPhone to your computer and open the iPhone's playlist in an iTunes window. Copy/Paste the entire playlist into a new(!) playlist in iTunes, not on your iPhone. Then resort the playlist. After you sort it, Copy/Paste it to a new(!) playlist on your iPhone. Now delete the old playlist on your iPhone and rename the new playlist the name you want it to be (probably the same name as the old playlist).
    The downside to this method is that you have to do it every time you add a song to the playlist. Unfortunately, I don't think there's another way.

  • ICal Print List - Why are to-dos randomly sorted?

    When printing from iCal in the list view, my To-Do List is NEVER sorted the way I sorted it in the main iCal window (whether by Calendar, Priority, or Manually). Instead it's just sorted randomly, which is very unorganized.
    Does anyone know why this is, or what can be done to fix it?

    It sounds like from your description that you're entering a date as a string in the todo description. Ideally you should be entering the date as the due date. This will help the sort order both in iCal and when printing. When you decide to print the To Do List, make sure View is set to List. Only check To Dos. In the time range, select the range you want to see. Anything without a due date will be printed under the heading To Dos without Due Date.

Maybe you are looking for

  • Mac noob needs monitor help! how do I...

    I was given a 2003 imac as a gift. I've always had PCs but was thrilled to have my first mac to play around with. The bad news is that about half the time the monitor doesn't work!!! I turn the computer on and the screen comes on for a split second a

  • Map event oddness 3.5.2 - 3.5.3 - possible bug?

    Hi Guys, I’ve discovered some odd event behaviour as part of my work to upgrade Coherence from 3.5.2 to 3.5.3/465p2 and to the latest incubator patterns. Much of our application is driven by a backing map listener attached to every cache. That feeds

  • Invoice Correction Request - RK

    I created an invoice correction request with reference to an invoice. Changed the quantity on it from 3 to 1. So the customer will need to pay less than what they were supposed to pay. No amount has yet been received from the customer. Now where do I

  • Performance Tunning - Could anyone please help

    I have a procedure which uses two offensive queries.The currenttime its taking is approximately 2 min in DEV and in PROD 20 min. Target is to reduce time to less than a minute in DEV and max 5 min in PROD. PROBLEM1######################### I think no

  • How to monitor and tune DB2 based SAP system?

    For Oracle performance, we have following ways to Monitor : st02, st03n, st06, st05 tune:  update analyzer, update statistics, buffer read-only tables, add buffer size For DB2, do we use the same method OR there are some more methods? Thanks a lot!