Sorting a Vector while entering data

Hi, I want to sort the data of a vector as data is entered, the vector is going to contain a tree type structure in other words each element inside the vector can link to another vector in an element.
I have this add procedure at the moment which doesn't work.
public void add (char i)
     TreeNode node = new TreeNode(i);
     if (child.contains(node) == false) /* does the tree contain the node */
     int f = 0;
     boolean inserted = false;
     while (inserted == false)
     if (node > child.elementAt(f));
          f++;
     else
          child.addElement(node);
          inserted = true;
     else
     System.out.println (" The child already contains the child");
And this is my calls for the procedure
class TreeNodeTest
public static void main (String[] args)
TreeNode nodes = new TreeNode('Z');
          System.out.println ("The variable held in the node is " + nodes.data());
nodes.add('d');
nodes.add('c'); //the elements put into my tree
nodes.add('a');
nodes.add('a');
System.out.println(nodes.numChild());
So z is the root node and d,c,a are its children. Please Help

I don't see any sorting going on there, and I don't see any vectors. And you didn't say what your problem was. Want to try asking a better question?

Similar Messages

  • Error While entering data in VA01

    Hi,
    I get the following error while entering data for "Plant" in Sales order creation (VA01). Can anyone please tell me how to solve this problem.
    Runtime Errors SAPSQL_INVALID_TABLENAME
    Except. CX_SY_DYNAMIC_OSQL_SEMANTICS
    Date and Time 27.04.2009 12:57:13
    Short dump has not been completely stored (too big)
    Short text
    A table name, specified in an SQL command, is unknown.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLV61Z" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
    not caught in
    procedure "SEL_KONDTAB" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    An invalid table name "A996" was specified in an Open SQL command:
    Due to one of the following reasons, the error occurs only at runtime:
    - the table name was specified dynamically, or
    - the SELECT clause, WHERE clause, GROUP-BY clause, HAVING clause, or
    ORDER-BY clause was specified dynamically.
    Missing RAISING Clause in Interface
    Program SAPLV61Z
    Include LV61ZU01
    Row 260
    Module type (FORM)
    Module Name SEL_KONDTAB
    Trigger Location of Exception
    Program SAPLV61Z
    Include LV61ZU01
    Row 724
    Module type (FORM)
    Module Name SEL_KONDTAB
    Source Code Extract
    Line SourceCde
    694 and kschl = se_kschl
    695 and datbi >= se_date
    696 and datab <= se_date
    697 and (coding_tab).
    698 endif.
    699 endif.
    700 else.
    701 if t681-ksdat is initial.
    702 if not <entrytab> is assigned.
    703 select * from (t681-kotab) appending table <cond_tab>
    704 where kappl = se_kappl
    705 and kschl = se_kschl
    706 and (coding_tab).
    707 else.
    708 select * from (t681-kotab) appending table <cond_tab>
    709 for all entries in <entrytab>
    710 where kappl = se_kappl
    711 and kschl = se_kschl
    712 and (coding_tab).
    713 endif.
    714 h_subrc = sy-subrc.
    715 if select_split ne 0.
    716 modify coding_tab from coding_alter index select_split.
    717 select * from (t681-kotab) appending table <cond_tab>
    718 where kappl = se_kappl
    719 and kschl = se_kschl
    720 and (coding_tab).
    721 endif.
    722 else.
    723 if not <entrytab> is assigned.
    >>>>> select * from (t681-kotab) appending table <cond_tab>
    725 where kappl = se_kappl
    726 and kschl = se_kschl
    727 and datbi >= se_date
    728 and datab <= se_date
    729 and (coding_tab).
    730 else.
    731 select * from (t681-kotab) appending table <cond_tab>
    732 for all entries in <entrytab>
    733 where kappl = se_kappl
    734 and kschl = se_kschl
    735 and datbi >= se_date
    736 and datab <= se_date
    737 and (coding_tab).
    738 endif.
    739 h_subrc = sy-subrc.
    740 if select_split ne 0.
    741 modify coding_tab from coding_alter index select_split.
    742 select * from (t681-kotab) appending table <cond_tab>
    743 where kappl = se_kappl
    Thank you in advance....
    Regards,
    Sriram.

    An invalid table name "A996" was specified
       in an Open SQL command
    Find out the transport request pertaining to Table A996 and ensure that both that request and the configuration request pertaining to that table are moved simultaneously.
    thanks
    G. Lakshmipathi

  • In UDT while entering data, error occurs

    hi everyone,
    I have created a udt and have entered the data in it but now when i am tying to add new data into it, it is showing me the error
    "The entry already exists in the table"
    can anyone suggest me wy it is happning so.
    Regrds,
    Meghana

    Hi Meghana.......
    Just delete the last recent entry you did and enter it again and then enter the new one.
    Hope this will help you to add....
    Try this in test DB......
    Regards,
    Rahul

  • Calculations while entering data into table via table maintenance generator

    Hi all,
    This is the following requirement.
    I created a ztable and also I created the table maintenance generator.  I have two fields which accept integer data.
    The requirement is when I enter value in the first field from the tcode SM30 the data should be populated into the second field automatically by subtracting the first value from 100.
    Can anyone explain me how I can do that.
    Thanks,
    Daniel

    hi,
    take the help of events in TMG and write the code in that event
    like field2 = field1 - 100
    steps to create events
    Step: 1: Create a table
    Step: 2: In SE11, go to Utilities --> table maintenance generator.
    Step: 3: Follow the path Environment --> Modification --> Events.
    Step: 4: Click new entries, select a table maintenance dialog event which suits your requirement.
    Step: 5: Create a form routine.
    Step: 6: Include your logic in the routine created in step 5.
    Hope this helps you.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc
    Re: bdc
    reward if helpful
    prasanth

  • Short Dump while entering data in VF01

    Runtime Errors         SAPSQL_INVALID_FIELDNAME
    Except.                    CX_SY_DYNAMIC_OSQL_SEMANTICS
    Program                               SAPLV61Z
    Include                                 LV61ZU01
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
         not caught in
        procedure "SEL_KONDTAB" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        An Open SQL clause was specified dynamically. The contained field name
        "WERKS" does not exist in any of the database tables from the FROM clause.
    Error found in these codes.
    if se_read_all_prestep is initial.
              select * from (t681-kotab) appending table <cond_tab>
                     up to 1 rows
                     where kappl  = se_kappl
                     and   kschl  = se_kschl
                     and   datbi >= se_date
                     and   datab <= se_date
                     and   (coding_tab).
              h_subrc = sy-subrc.
    I had debug the codes and found that when t681-kotab = A752 and line in coding_tab is ALAND = 'DE' and WERKS = 'XX' and VSTEL = 'XX' and LLAND = 'NL'. I will hit error because in A752 table, field WERKS does not exists!
    I guess this is a config problem but I do not know how to fix it.
    Appreciate helps. Thanks a lot.

    Hi,
    I executed v/07 but I cannot find the 752 table.
    T-code: v/07
    Usage: A
    Application: V
    Access sequence: MWST
    Access No: 08, Table = 78
    Access No: 10, Table = 2
    Access No: 20, Table = 11
    Please assist. Thanks.

  • Error entering data in a data form using Smart View

    One of my user is facing an issue while entering data in a data form through Excel, if she uses the same data form in workspace she is able to enter data. She is facing the issue while entering in a specific column, for all other columns she is able to enter data in the data form. It is only one column for which she is facing issue while using smart view/excel and not workspace, as in workspace she is able to enter data.
    Thanks,

    Hi
    Check they have the "Data Form Write Back from Excel" role in Shared Services.
    See p.133 of the security guide for more info -
    http://docs.oracle.com/cd/E17236_01/epm.1112/hss_admin_1112200.pdf
    Regards
    jpr

  • SAP BPC 7.5 SP3 and Citrix Entering Data through BPC Client and Citrix

    Hello BPC experts,
    my client is using SAP BPC 7.5 SP3 in combination with Citrix. We are having problems now, while entering data through the BPC Client (installed on BPC Server) and the BPC Client (running on Citrix).
    When we enter data through the BPC Client (Server) and expand the sheet, we can only see the data that we entered through the BPC client (Server). When entering data through the BPC Client (Citrix), we can see only the data we enter through the BPC Client (Citrix).
    The database, however, saves both entries correctly. For test purposes we created a test report which shows both entries correctly in the BPC Client on the server and on Citrix.
    Does anyone have an idea what can be wrong with our system? We tried to create an EvDRE log File for this BPC version as well, but failed. Maybe one of you already did that and can help me with this.
    Thanks in advance!

    You can greatly improve your chance of receiving a helpful answer to your question if you state the version (MS or NW) of BPC which you are using.
    Also notice the sticky [note|Please do not post BPC, SSM or FI/CO questions here!; at the top of this forum whereby we announced new dedicated forums for BPC which are the proper place to post your questions regarding BPC in the future to be able to reach the right audience for your question.
    Thanks and best regards,
    [Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
    SAP Labs, LLC
    BusinessObjects Division
    Americas Applications Regional Implementation Group (RIG)

  • Sort 2 Vector containg Objects

    I have 2 Vector , both contains objects
    I merge both the vector and make one Vector of Objects.
    Now i want to sort the Vector with the date filed.
    Can anybody write the code sorting the vector of objects on the basis of Date.?

    I have Vector name Employee( this contais object)
    Attribute: Name , Age , Date(on which user make entry:sysdate)
    like :
    Vector Employee= new Vector();
    Collections.sort(list,comparator);
    Plz help me how to use this Collections.sort(list,comparator);?
    What should be the code for comparator.?

  • Sorting While maintaining data through SM30

    Hi Techies,
    I have developed a z-table with key fields a,b & c. Now when I am entering data through SM30, C(Char field) field is getting sorted after saving.
    My requirement is to store the data in table without any sorting. Actually this field C has some sequencing issue. So, Is there  any event for table which can be used to resolve this issue.
    Note: I have already tried Event 01 by creating a new include and giving my ID breakpoint. But its noty trigerring .
    Any advice would be deeeply appreciated.
    Thanks & Regards,
    Vinit

    Hi Florian,
    Actually The field 'C' mentioned above contains the name of chemical compounds. I am fetching this data from databse and displaying in printout. In printout the user wants the field 'C' should get displayed accoridng to Chemical Sequence.
    Currently the data in Legacy system is stored in that manner. I just wanted to know if v can restrict the sorting of field C, Than i dont have to write extra logic for displaying data in printout.
    Hope you understand the exact issue.
    Any suggestions would be appreciated.
    Note: yes i checked in SE16, SE16N & SE11, but same issue.
    Regards,
    Vinit
    Edited by: vinit005 on Sep 16, 2011 9:33 AM

  • Error while entering Applicant Data PB10

    Dear Experts...
    While entering the initial data of applicant when in save the data ann error occurs : "No application assigned to this applicant no. (Infotype Application)".
    I have checked all integration components they are working fine. I also check the number ranges they are also assigned properly. Plz help.

    Dear Delik...
    I am selecting that.... Even then system gives me error....Even number ranges are properly choosen and activated. Basically this is not error message....its simple message but system doesnot allow us to save the data. Simple message means it is marked with Green tick... not red cross.

  • One to one relationship between records while entering in MDM data manager?

    Example Scenario::
         I have created <b>Employee details</b>(main table) and<b> Salary</b> (look up flat table for employee number filed in main table) .  Tried to get the corresponding employee's gross salary from <b>salary</b> table to <b>employee Details</b> table basing on <b>Employee number</b> field in Employee Details table as <b>Gross salary</b> and <b>Employee number</b> are common fields for both the tables. But i could not get one to one relationship in this case , Please explain how to achieve?

    Employee Details (Main Table)
                   EmpNo(Look up field)      EmpNa     GrossSal(Look up field)
    Salary Details  (Look Flat Table)
         Empno         Basic Sal        GrossSal   
          012              5000             10000
                     013              4000               8000
    I have created two tables with the above fields. In main table i kept two look up fields to Salary Details table. First i have entered data to salary table as above , now when i am trying to enter data in to main table EmpNo as 012 it should show Gross salary as 10000 automatically as per the corresponding EmpNo. Instead it is showing all the Grosssal values of Salary table.

  • How to sort a Vector that stores a particular object type, by an attribute?

    Hi guys,
    i need help on this problem that i'm having. i have a vector that stores a particular object type, and i would like to sort the elements in that vector alphabetically, by comparing the attribute contained in that element. here's the code:
    Class that creates the object
    public class Patient {
    private String patientName, nameOfParent, phoneNumber;
    private GregorianCalendar dateOfBirth;
    private char sex;
    private MedicalHistory medHistory;
    public Patient (String patientName, String nameOfParent, String phoneNumber, GregorianCalendar dateOfBirth, char sex) {
    this.patientName = patientName;
    this.nameOfParent = nameOfParent;
    this.phoneNumber = phoneNumber;
    this.dateOfBirth = dateOfBirth;
    this.sex = sex;
    this.medHistory = new MedicalHistory();
    Class that creates the Vector.
    public class PatientDatabase {
    private Vector <Patient> patientDB = new Vector <Patient> ();
    private DateFunction date = new DateFunction();
    public PatientDatabase () throws IOException{
    String textLine;
    BufferedReader console = new BufferedReader(new FileReader("patient.txt"));
    while ((textLine = console.readLine()) != null) {
    StringTokenizer inReader = new StringTokenizer(textLine,"\t");
    if(inReader.countTokens() != 7)
    throw new IOException("Invalid Input Format");
    else {
    String patientName = inReader.nextToken();
    String nameOfParent = inReader.nextToken();
    String phoneNum = inReader.nextToken();
    int birthYear = Integer.parseInt(inReader.nextToken());
    int birthMonth = Integer.parseInt(inReader.nextToken());
    int birthDay = Integer.parseInt(inReader.nextToken());
    char sex = inReader.nextToken().charAt(0);
    GregorianCalendar dateOfBirth = new GregorianCalendar(birthYear, birthMonth, birthDay);
    Patient newPatient = new Patient(patientName, nameOfParent, phoneNum, dateOfBirth, sex);
    patientDB.addElement(newPatient);
    console.close();
    *note that the constructor actually reads a file and tokenizes each element to an attribute, and each attribute is passed through the constructor of the Patient class to instantiate the object.  it then stores the object into the vector as an element.
    based on this, i would like to sort the vector according to the object's patientName attribute, alphabetically. can anyone out there help me on this?
    i have read most of the threads posted on this forum regarding similar issues, but i don't really understand on how the concept works and how would the Comparable be used to compare the patientName attributes.
    Thanks for your help, guys!

    Are you sure that you will always sort for the patient's name throughout the application? If not, you should consider using Comparators rather than implement Comparable. For the latter, one usually should ensure that the compare() method is consistent with equals(). As for health applications it is likely that there are patients having the same name, reducing compare to the patient's name is hazardous.
    Both, Comparator and Comparable are explained in Sun's Tutorial.

  • Short dump while saving data after selecting '#' for variable in WI

    Hello All,
    We have a selection variable in our webinterface on company code.After selecting '#',i am entering data and while saving it goes to dump.
    but client wants to have an error message displayed after saving data instead of runtime error (dump).so that user can select required company code.
    Error analysis is:
    A RAISE statement in the program "SAPLRSDRI" raised the exception   
    condition "ILLEGAL_INPUT".                                          
    Since the exception was not intercepted by a superior program       
    in the hierarchy, processing was terminated.                        
    Short description of exception condition:                           
    For detailed documentation of the exception condition, use          
    Transaction SE37 (Function Library). You can take the called        
    function module from the display of active calls.                   
    Is there any way to get desired  result?
    Thanks

    Hello Murali,
    What you would need to do is to change the attributes of the variable.
    1. In BPS0, you can make it as a mandatory entry.
    2. In the web layout, you can create a variable for Company code and force the user to choose a value from a dropdown list.
    The specific approach would depend on how the layout is being called and how it has been setup.
    Hope this helps.
    Sunil

  • SQL Error while creating data Owner certification in SRM 5.0.3

    Hi , In SRM 5.0.3, while creating data Owner certification by choosing data owner, I m getting the following error. database i upgraded and the migration script is also run.
    java.sql.SQLException: Violation of PRIMARY KEY constraint 'pk_id_attr_val_users'. Cannot insert duplicate key in object 'dbo.id_attr_val_users'. Since Primary key is clustered(cert_id,user_id,attr_val_id) and we have updated currentvalue of CertificationID in sequences table, We are not sure if SRM is trying to enter duplicate attribute value for same user in D.O certification. Any pointers regarding this error will be of great help, thanks.

    Solved but not happy!
    VIN is not compatible with a web UI that uses standard ports, i.e. TCP 80 and 443. No notes (at least that I seen) in the documents stating this as a requirement.
    KB 2065986
    VMware KB: VMware vRealize Infrastructure Navigator is not accessible when the vSphere Web Client is not running on …

  • OBJECTS_NOT_FLATLIKE error while transfer data to a file .-

    Hi experts,
    I am getting a dump OBJECTS_NOT_FLATLIKE
    while transfer data from internal table to a file .. File contains basically bank transmitting data in SAP
    Appreciate your advise and help ...
    Thanks

    Hi,
    1. If your files are on a remote File System, you will need to copy one of your files to the machine ODI Designer is running on to allow ODI to retrieve the metadata information of the file.
    2. In Topology create a Physical Schema, the directory you enter for Data and Work Schema should point at this local file.
    3. Then define the File Datastore in ODI Designer. Enter a name, browse and select the file and fill in each filed of the Files tab.
    * If its a Fixed file, click on the grid icon on the Columns tab to enter the columns and have Automatic Adjustment checked.
    * If its a Delimited file, use the Reverse button on the Columns tab to reverse the columns.
    * Right click on the File Datastore select View Data, if you can view data, that means the File Datastore has been defined correctly.
    * If not, check each tab of the File Datastore to make sure everything is defined correctly and retry.
    4. Once View Data is successful, you now change the directories (Data and Work Schema in Topology) to point at the remote File System. These directories must be accessible to the ODI Agent that will be used to run the transformations. The directory can be an absolute path (m:/public/data/files) or relative to the ODI Agent startup directory (../demo/files). It is strongly advised to use a UNC (independent from the execution location) for the path. When running the transformations with "no agent", the directory is relative to the directory where Oracle Data Integrator has been installed.
    You need to have a agent process running at the system where your source file resides .
    Then while running the odi interface choose that agent .
    Thanks,
    Sutirtha

Maybe you are looking for

  • Speaker is no longer working

    My speaker is no longer working on my IPhone 4s; I can't listen to music, hear the phone ring or listen to Siri.  I can hear everything just fine with earbuds or when it is connected to a docking station.  I reset all content & settings, powered down

  • Ws adapter only works with ABAP system?

    Hello all I am working with PI 7.1. We have used ws adapter where the corresponding sender or receiver is ABAP system. Now we're trying to use ws sender adapter from Java. So ws CC and sender agreement is configured, wsdl is generated. In NWDS CE 7.1

  • FRM-47032 : when converting from forms6i to forms10g

    Hello, There is a weird error I get when I execute a form that I have converted from forms6i (in a 8i db) into forms10g There is no pb when I execute de form in the 8i db But, it seems that the initialisation of a parameter cannot be done in the same

  • A Question on the iPhone SMS Hack

    If your text messaging feature was blocked on your plan so like no messages you send or any one sends to you would go through. Would that SMS Hacking message go to your phone?

  • License Issue on Back Up Ciscoworks Server

    We are trying to setup a backup server for our primary Ciscoworks server to get redundancy . We setup the new server and restored the backup on the redundant server and is working fine. However when we click on any of the installed modules say RME ,