How to get first item of hashMap w/out knowing the key

Hi
can someone tell me if there is a way to get first item from a hashMap when you dont know what the key is. as the get method expects a defined 'key'
reason I am asking this:
I am using struts 2 UI <s:radio> tag. this tag takes a hashmap and creates radio maps. it has a 'value' attribute and if something is passed to this attribute then that radio button is checked by default. the list that contains radio buttons is created dynamically so i dont know what is actually in the hashMap key's. but i do know that key's are string.
so just wondering if there is a way to get first item from a hashmap without knowing the key...

thanks for the quick reply.
posted in java forums because thought it was a java API/workaround question. gave a little history because i didnt want people to start questioning my use of HashMap for this purpose..
anywhose..i've found a workaround.
If someone has a similar problem:
as the hashmap is being populated dynamically....set a String member of class to contain the first key thats being put in the hashmap. then have struts tag pick up that value.
also, through your post and reading hashMap api...its usefull to know that hasMaps do not gurantee the order of elements in it. So now I am using a TreeMap.
Thanks

Similar Messages

  • How to get data from COSP table, field HRKFT as the key to data from PM?

    Dear ladies and gentlemen!
    I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
    The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
    All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
    What should I do in this case?
    Thank you very much in advance!

    From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
    Of course, it's not a very good solution, but for now I know no other way to solve this problem.
    Maybe someone knows better ways? In this case I will be very grateful for any help!
    Moderator: You'd better post it on BI forums

  • How to get first level BOM material if I know 4th level material code only?

    Dear all,
    I have 4th level BOM material only. How to find first level ( finish material) BOM material ?
    We can find bottom level material easily through CS11 if we know top level material.
    But how to find top material if we don't know ? we know only bottom most material.........
    Thanks....

    Kishore,
    Multiple runs of "CS15" will help you.
    Regards,
    Prasobh

  • How to get Ken Burns effect to zoom out so the whole pic is visible

    I want to start or end with the full pic in view - just as the FIT command does.
    Then I want Ken Burns to Zoom/pan to make it interesting.
    But I can't figure out how to re-size the frame beyond the 4:3 (or whatever is restricting it) ratio.
    Tried dragging the frame edges with CTRL, ALT, SHIFT, and COMMAND. Nothing seems to release the constraint.
    Thanks in advance.

    I want to start or end with the full pic in view - just as the FIT command does.
    If by "Fit" you mean the image exactly matches the display area, then you would have to "pre-crop" your scan to one of the available aspect ratios either before or after making your scan. If by "Fit" you mean "letterbox" or "pillar" views, then as Appleman said, you would have to either use the mentioned automator action or almost any graphic application. I prefer the manual approach so I can add a "text" area, frame, texture the background and/or image, and/or create other special effects.
    But, how do I zoom the view out past the edges of the photo? If I press the FIT button in KB effect, it does it. But I loose the ability to zoom/pan... Unless there is some trick to getting KB effect to start or end with a FITted picture?
    There isn't. iMovie '08 automatically scales the content to make the smallest dimension "fit within" the display area and, therefore, does not allow the "over-zoom" effect of "fitting" the larger dimension within the display area. You can however do this in iMovie HD. So if you want the "built-in" capability, this is a case where you should be using the the older application -- otherwise you will have to letterbox/pillar the content to get iMovie '08 to "Fit" your image as you wish.

  • How to implement an OSS Note if you only know the key??

    Hi,
         I wanted to know if we can implement an OSS NOte if we only know the SSCR key.
    Any help will be appreciated.

    Hi,
    You can implement an OSS note through transaction SNOTE.
    Just download the OSS note from SNOTE and it will automatically be inserted in the standard code.
    If you are not able to download the note check for the note correction given.
    Implement the note correction in the standard program after getting access key.
    Regards,
    Subhashini

  • How to add several item to HashMap?

    I want to add more than one item to HashMap When I click the "submit" and I want to made a Shopping cart.But I can't add several item to the HashMap.It will clear the content that I added to it When I click the second time.Anyone have good idea?
    Mycode is://///////////////////////////////////////////////////////////////////
    <select name="item" size="3" multiple>
    <option value="jsp">jsp</option>
    <option value="asp">asp</option>
    <option value="PHP">PHP</option>
    </select>
    </p>
    <input type="text" name="itemnumber">
    <p>
    <input type="submit" name="Submit" value="submit">
    </p>
    </form>
    <%
    String item="asp";
    item=request.getParameter("item");
    String itemnum="1";
    itemnum=request.getParameter("itemnumber");
    int itemn=(Integer.valueOf(itemnum)).intValue();
    out.println("Your select is:"+item);
    out.println("Item number is:"+itemnum);
    HashMap cart;
    cart=new HashMap();
    cart.put(item,new Integer(itemnum));
    out.println("Your cart is:"+cart.entrySet());
    %>
    <HR>
    <table border="1" bordercolor="red">
    <%
    String str="";
    out.println("your select:");
    str+="<tr><td>"+cart.entrySet()+"</td></tr>";
    out.println(str);
    %>
    Thank you!

    Thank you tolmank.It's works well.This is mycode after modify.But I find it also works well if I delete the last sentence "session.setAttribute("lyo",cart);".It must be writen?
    /////////////////////////mycode after modify//////////////////////////////////////
    String item="";
    String itemnum;
    String submit;
    int itemn;
    int oldcartnum;
    item=request.getParameter("item");
    itemnum=request.getParameter("itemnumber");
    submit=request.getParameter("Submit");
    try{
    itemn=(Integer.valueOf(itemnum)).intValue();
    }catch(NumberFormatException e){
    itemn=1;
    out.println("Your select is:"+item);
    out.println("Item number is:"+itemnum);
    HashMap cart;
    if(session.isNew()){
    cart=new HashMap();
    session.setAttribute("lyo",cart);
    }else if((session.getAttribute("lyo"))==null){
    cart=new HashMap();
    session.setAttribute("lyo",cart);
    }else{
    cart=(HashMap)session.getAttribute("lyo");
    if(submit.equals("Add")){
    try{
    oldcartnum=((Integer)(cart.get(item))).intValue();
    }catch(NullPointerException ex){
    oldcartnum=0;
         cart.put(item,new Integer(oldcartnum+itemn));
    //session.setAttribute("lyo",cart);
    out.println("Your cart is:"+cart.entrySet());
    %>
    <HR>
    <table border="1" bordercolor="red">
    <%
    String str="";
    out.println("your select:");
    str+="<tr><td>"+cart.entrySet()+"</td></tr>";
    out.println(str); }

  • How to get line item net price and net value?

    I have using "BAPI_SALESORDER_SIMULATE" to SIMULATE to create SO,
    the return table
    ORDER_ITEMS_OUT-NET_VALUE is not equals than created by VA01 .
    how to get line item net price and net value?

    Hi,
    Can u elaborate ur query ?
    By this FM you cannot create a SO . Use FM --> BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    MAdhukar Shetty

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How to get page item list in  a page?

    how to get page item list in  a page?

    Have a look at ISpread::GetItemsOnPage().
    That should get you started.

  • How to get po item condition type according schema group

    hi experts,
    i want to get po item condition type according schema group.
    for example, in xk03, if the "schema group, vendor"in purchasing data view is set to 'Z3', in the purchase order which is made for this vendor, the po item's gross price condition type is hwxx.
    if the "schema group, vendor" is set to 'Z2', the po item's gross price condition type is pbxx.
    my question is : how to get po item condition type according schema group?
    hunger for ur advice and thanks a lot!

    several steps you need to go
    1. you need to get the purcahsing group schema against your purchasing group from table T024E.
    2. get the vendor group schema from vendor master data table LFxxxxxx
    3. get the pricing schema from table TMKS via the selection criteria purchasing group schema and vendor group schema
    4. go to the table T683S via inputing Usage, application and pricing determination procedure.
    5. now you got it.

  • How to get Po item Delivery Date ?

    who can tell me how to get PO Item Delivery Date ?
    Thank You!

    hi
    good
    go through these links,hope these ll help you to solve your probelm
    http://web.mit.edu/sapr3/windocs/bpors03m.htm
    http://www.sap.com/southafrica/services/education/pdf/BPP.pdf
    thanks
    mrutyun^

  • How to get PO item level attachment

    Hi All,
    We created "Z" driver program for PO print, in driver program we convert PO into PDF format and attach that PDF with email.
    But we have PO ITEM LEVEL ATTACHMENT and for sending email we use standarf FM SO_DOCUMENT_SEND_API1.
    Everything working fine,we got mail with both PDF's(PO item level attachment and & PO converted PDF) but when we double click to open PDF which is attached in mail we got error message .
    So we decide insted of using standard function module use class to send mail, but challenge is HOW TO DOWNLOAD PO ITEM LEVEL ATTACHEMENT .
    Kindly suggest the solution.
    -NavinK

    Hi Navin,
    check this thread:
    it has the exact same question + solution
    [Send CV03N attachments present in Purchase order at line item level |Re: Send CV03N attachments present in Purchase order at line item level].
    Best regards,
    Steven

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • I just got the iphone 4s and i cant figure out how to get siri to work it seems to be the old voice command. HELP!

    i just got the iphone 4s and i cant figure out how to get siri to work it seems to be the old voice command. HELP!

    Did you enable Siri in settings?
    Settings > General > Siri > ON
    If Siri is off, all you get when pressing the home button for 1 second is the old Voice Control.

  • How to get last Build date of a dll in the real time target

    Info On My Project    
       I am working on LabWindows CVI 12.0 for development . This project is a real time application for hardware, which is having Phar Lap ETS as RTOS...  
    I am facing some problems while checking Build date of my Application file( .dll)
    I have tried to use GetFileDate API. But it is not supporting for realtime Target..
    So i have tried __DATE__ macro.. That also having some problems..
    How to get last Build date of a dll from the real time target  ??
    Please Help to solve this....
    Thanks
    Vaishakh A  K

    Please reply if any one have suggestion...

Maybe you are looking for

  • New Macbook Pro Wont Connect to Internet

    I just got a Macbook Pro today and it wont connect to the my wireless connection. The only thing I can think of is when I was in the start up it ask what I connected to the internet with and because I was not within my own network I press "This compu

  • How to define the Market Sales KF, in order to receive the desired result

    Hi all, I dont know how to define the Market Sales Kefigure, in order to get the following result. Any hint is more than welcome. Prd_ID = Product ID PS  =  Product Sales M_ID = Market ID MS  = Market Sales MS%  = Market Share ( formula in BEX PS/MS)

  • SD - VL009

    Hi Experts, I am facing problem in creating new customer. I receive message ("Sales area 1000 10 10 is not defined for customers") because I made changes in VOR1 (DCh-Conds was empty n i put 10 in there. It was for export sale) as I was receiving an

  • Cookie insert in the CSM module

    Hello I would like to ask if anbody know why when I use the "cookie insert" option in the CSM configuration with the timeout of 60 minutes, from the browser point of view the cookie expires in 2010? I have checked in on the CSM and CSM-S and in both

  • Migrate to JDeveloper 11 Technology Preview 2

    Hi, I just downloaded JDeveloper 11 Technology Preview 2 . Now I tried to migrate my project from Jdev 10.1.3 bit that give an error saying only that it could not migrate the project. Does migration normally work? And how can I get more information a