Changing data in previous element of ArrayList

I'm iterating through an array list which contains several data elements in each array, one of which is an account numbers which are sorted. If an account number is duplicated, I want to change data in both entries in the ArrayList.
for (ListIterator iter = myList.listIterator(); iter.hasNext();)
                  MyList vantageList = (MyList) iter.next();
      if ( iter.hasPrevious)
         MyList previousElement =  (MyList)iter.previous();
          previousElement.setAccountNumber(12345);
      if (imageLitr.hasNext)
         MyList nextElement = (MyList)imageLitr.next();
        nextElement.setAccountNumber(12345);
}but the previousElement is not being updated with 12345, and I'm not sure why.
thanks
Edited by: drakester on Oct 10, 2007 11:53 AM

drakester wrote:
This is the code I have and it's not updating the previous element in the list with "D" and I have no idea why?That code looks correct enough. There are a couple things you're doing which are unnecessary: You don't need to check for a null previousAccountNumber - assuming accountNumber isn't null (which it isn't or you'd have another problem), a non-null string is never equal to a null one. And there's no need to check for iter.hasPrevious nor hasNext, because if you have found a duplicate, obviously there is a previous item, it's the duplicate one you already saw. So you move to that item and mark it. Then obviously there's a next item too, because you just moved back one item and need to move forward again to the current item you were just working on.
Anyway, it looks like it should work, so I'd have to guess that:
1) You're not actually executing this code
2) The list isn't sorted when you execute this code
3) You're seeing the problem because of something else - not looking at this updated list, or something else updated it after this code executed and you're seeing the effects of that update, not this one.
4) setToD doesn't do anything
5) Something else

Similar Messages

  • Change date for cost element

    hi
         i created the cost element vaild from 01.04.2008 instent of 01.04.2007 then i saved. now i want change the date i.e valid from 01.04.2007,. i don't want delete the cost element in ka05 then create,
    i want change the validty with out deleting the cost element.

    Please read the post. WIth the suggestion you have given teh system will allow to change the period to a future date and not to the past date.
    In this case the hasc reated a cost element with effective from 2008 where as he wants to change this to 2007.
    system will not allow this.
    "You selected an analysis period extending beyond the period for which the object was defined. This is not allowed in the change or display functions."

  • How to change elements in ArrayList into String

    Greetings,
    i like to change elements in arrayList into string.
    This is how i declare an ArrayList in a Java file
    ArrayList listing = new ArrayList();below is just a simple example of how i insert the string into the arraylist
    String concat = "';
    concat = concat + "apple";
    //Transfer the concat string into arraylist
    listing.add(concat);
    return listing;
    {code}
    On my Jsp page, it will receive the ArrayList from the java file. Lets say the Arrayist is pass into my JSP arraylist
    This is my JSP arraylist
    {code}ArrayList optLists = new ArrayList();{code}
    Inside the arraylist element, it holds data eg: *308577;;RS | [CAT 2] Level: Arena, Section: A02* with a pipe between RS and CAT 2.
    Now i looping the arraylist
    {code}int a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              splitTemp =  tempString.split("|");
              System.out.println("Split String Results: "+ splitTemp);
         {code}}
    Heres the error:
    *SeatAvailable_jsp.java:560: incompatible types*
        *[javac] found   : java.lang.String[]*
        *[javac] required: java.lang.String*
        *[javac]             splitTemp =  tempString.split("|");*
        *[javac]*       
    What can i do to solve the problem?
    Edited by: leeChaolan on May 2, 2008 4:45 AM
    Edited by: leeChaolan on May 2, 2008 4:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    paternostro is right, you are returning an array into a string which is wrong
    but try this, i haven't tested it though..
    nt a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              String[] splitTemp =  tempString.split("|");
              for(String xyz : splitTemp)
                   System.out.println("Split String Results: "+ xyz);
         }Edited by: linker on May 2, 2008 1:17 PM
    Edited by: linker on May 2, 2008 1:18 PM

  • How to change data element of IDOC segment

    HI Experts,
    I have copied a segment E1ISU_MEASUREMENT_MEA to ZE1ISU_MEASUREMENT_MEA.
    Now i want to change data element of one of the field of the segment.
    Please guide me how i can do it?
    is there any disadvantages of doing this?
    can we do it easily?
    please give me step by step instructions if possible .
    thanks in advance
    Anit

    Hi,
    When you want to modify the segment details of a particular IDoc, you could do the same by editing the segment details via t-code, WE19. Once you edit, click on, Outbound or Standard Inbound if your IDoc is Outbound or Inbound respectively. A new IDoc will get generated. The generated IDoc will be in "yellow" status, ready to be picked up by a batch job if there exists one. Else you need to manually process the IDoc via the respective program.
    ~ Bineah

  • How to change data element in table?

    Hello all:
          I just need to change data element for a field in some Z table. I know I can do it through SE11 but I just want to make sure if there is anything I should be aware of? Are there any other steps I should perform apart from making changes through SE11? Any information you could provide would be great.
    Thanks.
    Mithun

    Hi Mithun,
    Yes, you can change the table using SE11. After saving, check for errors and activate. Using Menu, Utilities
    -> click on Database Utility and then click on 'activate and adjust database'.
    Hope this helps.
    Thanks,
    Srinivasa
    Message was edited by:
            Srinivasa Bhanuprasad Moningi

  • Table that contains the change date for every cost element

    Hi everyone!
    Can anyone please help me find a table which contains the change date for every cost element?
    Thanks,Jess

    If you basically want to find out if anyone changed the cost element, you need to use transaction KA05 and enter the cost element and controlling area.
    This would actually bring you whatever field was changed and on double clicking give you the actual change and the date on which the change was made.
    Problem is this change date is actually the creation date of a change document which is in the table CDHDR.Its not like the change date is on any master tables.
    Hope this helps
    Deepa

  • Can not change date from 2011 to 2012 in Elements 9 photoshop

    can not change dates from 2011 to 2012 in Elements 9 photoshop

    Thanks for the help. That was exactly  the fix I needed. With the expense of the photoshop software you'd think the company would fix stuff like this via updates. Merry Christmas.

  • CATW: Can't swith to next/previous week: changed data will be lost

    Hello!
    In CATW, when clicking on Previous or Next button without saving, we get the message: "Changed data will be lost". Even if we confirm this by clicking on "OK", the screen does not change and we remain on the first input.
    Does anyone know what is wrong? I already tried to look for a note without any result.
    Thanks a lot.
    Matthias

    Hi Sudhakar,
    We had a similar issue with CATW timesheet in ECC 6.0. This thread was very useful in getting the solution for our issue. As a novice to ITS application we stuggled a lot tyring to get our exisitng CATW application in 4.7 to work as an Integrated ITS application.
    We experimented with different parameters both on the service (SE80) and configuration parameters in SICF. Our current understanding is that the parameter value maintained in SICF overrides that in SE80.
    We have the following parameters in SE80 for CATW service:
    ~SINGLETRANSACTION 1
    ~THEME 99
    ~WEBGUI 1
    ~WEBGUI_SIMPLE_TOOLBAR 1
    We have the following parameters in SICF for CATW service:
    ~WEBGUI 1
    ~THEME 99
    ~WEBGUI_SIMPLE_TOOLBAR 32
    ~SINGLETRANSACTION 1
    ~TRANSACTION CATW
    With this the old CATW screens are working. I understand ~THEME 99 (Do not use sl) will allow to get the old CATW screens.
    One more thing we did is that we synchronized all the templates and mime objects in ECC 6.0 with 4.7. Except for screen 4000 rest of the templates are in sync. This screen is missing in ECC 6.0
    We activated the SAP ICons, Mimes services in SICF as well.
    With this the old CATW ITS application is working fine as an Integrated ITS application.
    If we set the value of ~TRANSACTION CAT2 we get the new CAT2 screens with missing icons. However we would like to stick to older ITS application look and feel so we are not bothering about this any more.
    Regards,
    Anu

  • How to get a value from the previous element (XSLT/XPATH gurus ahoy!)

    Hi All,
    I am building an RTF template for a "letter of reference"-report. Sometimes there are several rows in the data, that need to be printed as one. This is due to consecutive temporary contracts, which will be printed out as one period of service.
    Here's a simplified data example to illustrate the problem.
    <ROW>
    <START_DATE>01-01-1980</START_DATE>
    <END_DATE>01-01-1988</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-1988</START_DATE>
    <END_DATE>01-01-1990</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-2000</START_DATE>
    <END_DATE>01-01-2005</END_DATE>
    </ROW>
    With the data above, I should print two lines:
    01-01-1980 - 01-01-1990
    01-01-2000 - 01-01-2005
    I need to compare START_DATE of an element (except for the first one) with the END_DATE of the previous element, to find out whether to print the END_DATE for that element or not. How can I get that value from the previous element?
    Thanks & Regards, Matilda

    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

  • Identifying Changed Dates on Documents in SAP B1

    Greetingsu2026I have an unusual request that is somewhat long, very serious, and hope folks can help. 
    A headquarters customer believes a subsidiary company has u2018made upu2019 dates on invoices for previous billings.  They describe the date changes as u2018radicalu2019 but I have not personally seen these invoices as of yet and am waiting a FAX.  They requested I go into SAP B1 to see if someone has fabricated or made up or changed invoice dates and who it was.  They have some specific large-dollar invoices identified to research.  The person under suspect (who is no longer there) was considered an expert in SAP B1, so maybe she knew all of the different ways to change dates around.  Being an expert means also she might have used some unusual ways to change dates to the ones she wanted.
    Here are some of my ideas to discover this situation, but I hope someone can suggest even more steps because I would like to know every way that this situation can be discovered.
    1. Open the AR Invoices and use Data > Change Log and concentrate on dates.
    2. Run some SQL to validate document dates and system dates.  SELECT T0.DocNum, T0.DocDate, T0.CreateDate, T0.TaxDate, T0.UpdateDate FROM OINV T0 WHERE (T0.DocDate does not equal T0.CreateDate OR T0.TaxDate does not equal T0.CreateDate).  The results would show invoices that maybe had their dates changed.
    3.Run a Document Journal in the Financial Module.  Finance > Financial Reports > Accounting > Document Journal with the u2018Expanded Selectionu2019 of AR Invoices and a date range covering the invoices in question.  Then see if the Transaction Numbers are out of sequence.
    4. Run a Transaction Journal Report Financials > Financial Reports > Accounting > Transaction Journal Report with AR Invoices.  Compare this report to Document Journal.
    5. Run the Utilities functions of Utilities > Check Document Numbering to see if there any anomalies there in the document numbers.
    6. Run the Administration > System Initialization > Document Numbering function to see if a special series has been set up.
    7. Check out the AR Invoice numbering order by running another simple SQL covering a range of the invoices in question. SELECT T0.DocNum, T0.TaxDate, T0.CreateDate, T0.UpdateDate FROM OINV T0 WHERE T0.DocNum > 1583 AND T0.DocNum < 3251 ORDER BY T0.CreateDate.  Then see if the AR Invoice Numbering Sequence is not consistent.
    8. Check out those documents that are connected to each suspect AR Invoice and their associated dates by using the Target and Base Document icons.  For example, if a Deliver Document has dates of January 2007 but the AR Invoice date is September 2006, then someone has played around with dates on at least one of the documents.
    9. Get copies of the complete company database before the alleged changes were made and a company database as of today and compare the two contents.  Only good if the backups are maintained for a long time.
    Here come the questions on the ways I BELIEVE dates can be changed but not sure how to find and need to work on them:
    QUESTION 1 u2013 If a person DTWs invoices up into SAP B1, how can I tell that DTW was used to change the dates, the date of the DTW run, and the dates that were changed?
    QUESTION 2 u2013 If a person uses SQL to update dates on SAP B1, how can I find out that SQL has been used, the date of the SQL run, and the dates that were changed?
    QUESTION 3 u2013 If a person goes out and changes the workstation and/or server Date and Timestamp Properties, how can I find that they did that and the date changes?  You can do this on your PC by just changing the month, date, and year in Microsoftu2019s Date and Timestamp Properties.
    QUESTION 4 u2013 I know SAP has a policy that no SQL can be used to update databases and/or tables and have been told some customers lost support because they did this.  What does SAP do to discover this in their lab?
    QUESTION 5 u2013 Are there any notes in the portals to help me find changed dates?
    QUESTION 6 u2013 Are there any logs SAP B1 produces that can help identify such changes and how do I find and use them?
    QUESTION 7 (and this is big) u2013 Are the other ways dates can be changed on AR Invoices and how would I uncover the way it was done and the needed information of Original Date and Changed Date?
    Many, many thanks for any help provided since this is a serious situation.  If you can make any suggestions it would be greatly appreciatedu2026
    Zal
    Edited by: Zal Parchem on Mar 13, 2009 7:31 AM

    Hi Zal
    If this person was an "Expert" on SAP Business One then the only way they would have changed dates would probably be directly in SQL itself. The best way to determine this would be to hope that they slipped up somewhere and forgot to change a particular date in let's say one specific table.
    For invoices, start with the post date, doc date & create date. Then check each of these to the OJDT/JDT1 tables for any discrepancies. Next check the ADOC/ADO1 table for multiple instances on the invoice. If only 1 instance then check the create date, time & user as well as the aforementioned dates between OINV/INV1 & ADOC/ADO1. If multiple instances, check the dates from 1 instance to the next (This will indicate dates being changed in the system).
    Next check the same dates against OINM table. If any of the dates do not tally then the SQL was changed directly.
    Hope this helps. Let me know if you need further assistance.
    Kind regards
    Peter Juby

  • Table for Delivery changed data

    Dear Gurus
    There is a requirement to create a z report based on delivery details. As according to the business process, the delivery weight is changed by z activities somedays after creation of delivery. Is there any table from which i can get the previous (old) value of weight which is now replaced by new weight value. (As this can be seen in delivery change data details, it shows the previous weight value and new weight value but i cant find the table for it)
    Thnx in advance
    Deepak Mehmi

    Hi
    Since Lakshmipati has already answered the question just to add on in CDHDR with VL02N you can find the object class as LIEFERUNG for any change in net weight. You can query in CDPOS with object class as LIEFERUNG as Object class and Object Id as the delivery number (with preceeding zeros-to make it 10 digits). The FNAME would be BTGEW for gross weight and NTGEW would be for net weight. The VALUE_NEW would give the new value and VALUE_OLD would give the old value.
    Thanks
    Indranil

  • How to change data source name and context root during deployment

    Hi,
    Env:
    WLS 10.1.3
    JDev 11.1.1.6
    Hudson
    I need to deploy two instances of my ADF application on the same development enviroment. We are using Hudson to deploy. My question is how to change data source name and application context root before second deployment.
    Kuba

    I don't believe there is an inbuilt facility to do this.
    Previously how I've done this is when checking files out using Hudson jovs, before the build I then use an Ant extension called XmlTask (http://www.oopsconsultancy.com/software/xmltask/) to modify the required XML files.
    Can I ask why you're doing this in the first place please? Multi-tenancy? 2 versions of the same app?
    CM.

  • Adobe Reader XI did not save the form data (unlike previous versions). Any way to recover file?

    Adobe Reader XI did not save the form data (unlike previous versions). Any way to recover filled form with data from temp locations?
    I was not aware that ctrl+s no longer works in reader and closed the PDF after savign it(with ctrl+s). However ,the data is lost and there seems to be no way to recover it.
    I cannot find any temp files created by Reader on my system.
    Also to my surprize(and shock), the reader did not even show a warning before closing the PDF. Does anybody know if/where can I recover the file from?
    Guys, Please reply ASAP if you have got any sort of solution!

    Hi Pat,
    Are you using Adobe Reader XI? And not Acrobat. It does not ask me to save the form if there are unsaved changes.
    I have used previous versions of reader for saving this form data and it did allow me to save it with ctrl+s. And those versions did prompt me to save the changes before closing.
    I guess I should not have updated the reader.

  • Changing data in 'hidden' fields through BSP

    Hi all,
    We are using custom copy of hap_document BSP and in there i am trying to change values in the appraisal document using application->doc. I am able to change the values for the fields that are displayed in the layout in the application->doc-t_body_cell_notes, but not able to change the values for hidden fields(that have 'H' in application->doc-t_body_cells-cell_note_availability).
    Is it impossible to change data for hidden fields?
    Please let me know if anyone of you had ever done something like this earlier.
    Thanks,
    manasa

    Thanks Raja.
    In the HAP_DOCUMENT there is a cell for employee comments. Now i am hiding the cell in the BSP and when user clicks on a dropdown i am changing the value in the cell say from ABC to XYZ programatically. The document is being updated with the XYZ value when the cell is either in change/display mode but not in hidden mode. in hidden mode, When i change the value to XYZ and save the cell gets empty and doesnt have the previous value ABC also.
    I am changing the value in the cell using below code:
       READ TABLE application->doc-t_body_cell_notes INTO s_cell_notes
         WITH KEY column_iid = '0001' row_iid = '0002'.
       IF sy-subrc = 0.
         s_cell_notes-tdline = 'XYZ'.
       ENDIF.
       MODIFY application->doc-t_body_cell_notes
          INDEX sy-tabix  FROM s_cell_notes
          TRANSPORTING tdline.
       ENDIF.
    ENDIF.
    if you have any questions please let me know. I am assmuing that you have worked on the BSP HAP_DOCUMENT.
    Thanks again,
    manasa

  • Table name for Info-record where i can get the last changed date and user

    Using ME12, i have changed the price of the info record i want to get the who was the user and changed date...
    I had check in EINA EINE but i couldnt find out please anybody Please help me out by providing solution for this??

    Hi
    If at the data element level the field for which you want to know the old and new fields  the option of CHANGE DOCUMENT option must be  enabled ,then you can find the old and new values in the
    CDHDR -
    Change document header
    CDPOS -
    Change document items.
    Regards
    Pavan

Maybe you are looking for

  • I need some help here please!

    i am working on a website thats going to be a friend loop such as facebook myspace classmate etc. im in the proccess of making the site now and i was wondering what i need to to to enable useres to be able to login and create a profile page on my sit

  • How to select multiple items in JComboBox

    Is it possible to select multiple items in a JComboBox if yes, then how to do? If no , then is there any other way to acheieve this ?

  • Query Related problem

    Dear All , I am new to BI . I am facing one problem please help me . There is report which shows the period wise cumulative balance of G/L accounts for entered company code , Fiscal year and Ledger type entered on selection screen . As of on the sele

  • Paning in Audition From Back to Front

    Paning in audition is the great thing I tried to rotate pan and sound goes around you with all beauty But what if I want to pan from back to front or left from right ?

  • Update BP currency failed in DTW

    Dear All, I tried to update BP currency by using DTW. I have the recordkey, BP code, currency code  in the txt file. However, only 4 of them are done. Others are failed. I got an error message: cannot find this object in B1Application-defined or obje