Problem with Collections.binarySearch()

public class TaxPayerRecord implements Comparable <TaxPayerRecord>
private String nric;
private String name;
private String dateOfBirth;
private String gender;
private String blockNo;
private String unitNo;
private String streetName;
private String bldgName;
private String postalCode;
private long totalIncome;
private long totalDonation;
private long totalPersonalRelief;
* Creates a new instance of TaxPayerRecord
public TaxPayerRecord(String nric, String name, String dateOfBirth, String gender,
               String blockNo, String unitNo, String streetName, String bldgName,
               String postalCode, long totalIncome, long totalDonation,
               long totalPersonalRelief)
this.nric = nric;
this.name = name;
this.dateOfBirth = dateOfBirth;
this.gender = gender;
this.blockNo = blockNo;
this.unitNo = unitNo;
this.streetName = streetName;
this.bldgName = bldgName;
this.postalCode = postalCode;
this.totalIncome = totalIncome;
this.totalDonation = totalDonation;
this.totalPersonalRelief = totalPersonalRelief;
public String toString()
return nric+"|"+name+"|"+dateOfBirth+"|"+gender+"|"+blockNo+"|"+unitNo+"|"+streetName+"|"+
bldgName+"|"+postalCode+"|"+totalIncome+"|"+totalDonation+"|"+
totalPersonalRelief;
public long getTotalIncome()
return totalIncome;
public long getTotalDonation()
return totalDonation;
public long getTotalPersonalRelief()
return totalPersonalRelief;
public String getDateOfBirth()
return dateOfBirth;
public String getPostalCode()
return postalCode;
public int compareTo (TaxPayerRecord next)
          return this.nric.compareTo(next.nric);
} //TaxPayerRecord
import java.io.*;
import java.util.*;
public class TaxPayerProgramme
     public TaxPayerProgramme()
                         String menu = "Options: \n"
                                        + "1. Compute And Print List Of Tax Payers (Sorted by NRIC) \n"
                                        + "2. Compute And Summary Of Tax Revenue \n"
                                        + "3. Search for Tax Payer by NRIC \n"
                                        + "Enter option(1-2,0 to quit): ";
                         System.out.print(menu);
                         Scanner input = new Scanner( System.in );
                         int choice = input.nextInt();
                         System.out.println("");
                    // Declaration
                         ArrayList<TaxPayerRecord> list = new ArrayList<TaxPayerRecord>();
                         String inFile ="TaxPayer2005.txt";
                         String line = "";
                         String nric;
                         String name;
                         String dateOfBirth;
                         String gender;
                         String blockNo;
                         String unitNo;
                         String streetName;
                         String bldgName;
                         String postalCode;
                         long totalIncome;
                         long totalDonation;
                         long totalPersonalRelief;
                    try{
                         //Read from file
                         FileReader fr = new FileReader (inFile);
                         BufferedReader inFile1= new BufferedReader (fr);
                    line=inFile1.readLine();
                                   while (line!=null)
                                   StringTokenizer tokenizer = new StringTokenizer(line,"|");
                                   nric=tokenizer.nextToken();
                                   name=tokenizer.nextToken();
                                   dateOfBirth=tokenizer.nextToken();
                                   gender=tokenizer.nextToken();
                                   blockNo=tokenizer.nextToken();
                                   unitNo=tokenizer.nextToken();
                                   streetName=tokenizer.nextToken();
                                   bldgName=tokenizer.nextToken();
                                   postalCode=tokenizer.nextToken();
                                   totalIncome=Long.parseLong(tokenizer.nextToken());
                                   totalDonation=Long.parseLong(tokenizer.nextToken());
                                   totalPersonalRelief=Long.parseLong(tokenizer.nextToken());
                                   TaxPayerRecord person = new TaxPayerRecord(nric,name,dateOfBirth,gender,blockNo,unitNo,
                                                                                          streetName,bldgName,postalCode,totalIncome,
                                                                                          totalDonation,totalPersonalRelief);
                                   list.add(person);
                                   line=inFile1.readLine();
                                   }//end while
                    inFile1.close();
                         }// end try
                    catch (Exception e)
                         e.printStackTrace();
                    }//end catch
                    do{
                              switch(choice)
                                   case 0:
                                   System.exit(0);
                                   break;
                                   case 1:
                                   // run list
                                   printList(list);
                                   break;
                                   case 2:
                                   printSummary(list);
                                   break;
                                   case 3:
                                   search(list,input);
                                   break;
                              }//end switch
                         System.out.print(menu);
                         choice = input.nextInt();
                         System.out.println("");
                         }// end do
                         while(choice !=0);
                         Collections.sort(list);
     }//end TaxPayerProgramme()
     private void total(ArrayList<TaxPayerRecord> list)
          // Declaration
          double total=0;
          // calculate total
               for (int i=0; i<list.size(); i++)
               total=+ tax(i,list);
          //print msg
          System.out.println("Total revenue collectable for year 2006 (S$): "+total+"\n");
     private double tax(int i,ArrayList<TaxPayerRecord> list)
          // Declaration
          double income;
          double tax;
          // calculate income
          income =list.get(i).getTotalIncome()-list.get(i).getTotalDonation()
                    -list.get(i).getTotalPersonalRelief();
          // calculate tax
               if (income>320000)
                    tax=(((income-320000)*0.21)+44850);
               else if (income>160000)
                    tax=(((income-160000)*0.18)+16050);
               else if (income>80000)
                    tax=(((income-80000)*0.145)+4450);
               else if (income>40000)
                    tax=(((income-40000)*0.0875)+950);
               else if (income>30000)
                    tax=(((income-30000)*0.0577)+375);
               else
                    tax=((income-20000)*0.0577);
          return tax;
     private void totalAge(ArrayList<TaxPayerRecord> list)
               // Declaration
               String msg;
               int i,age;
               double grp1=0;
               double grp2=0;
               double grp3=0;
               double grp4=0;
               // calculate revenue by age
                    for (i=0; i<list.size(); i++)
                    age= 2006- Integer.parseInt(list.get(i).getDateOfBirth().substring(6,list.get(i).getDateOfBirth().length()));
                    if (age>55)
                         grp4 =+ tax(i,list);
                    else if (age>35)
                         grp3 =+ tax(i,list);
                    else if (age>17)
                         grp2 =+ tax(i,list);
                    else
                         grp1 =+ tax(i,list);
               //print msg
               msg="Total revenue by age range (S$) \n"+
                    "\t"+"(1 to 17)"+"\t"+ grp1 +"\n"     +
                    "\t"+"(18 to 35)"+"\t"+ grp2 +"\n"     +
                    "\t"+"(36 to 55)"+"\t"+ grp3 +"\n"     +
                    "\t"+"(above 55)"+"\t"+ grp4 +"\n";
               System.out.println(msg);
private void totalDistrict(ArrayList<TaxPayerRecord> list)
               int count=1;
               double temp=0;
               double [][] array = new double [list.size()][2];
                    for (int i=0; i<list.size(); i++)
                    array[0]=Double.parseDouble(list.get(i).getPostalCode().substring(0,2));
                    array[i][1]=tax(i,list);
               System.out.println("Total revenue by district (S$) ");
                    do{
                              for (int a=0; a<list.size(); a++)
                                   if (count == array[a][0] )
                                   temp=array[a][1];
                              }//end for loop
                         System.out.print("\t"+"(district "+count+")"+"\t"+ temp +"\n");
                         temp=0;
                         count++;
                    }while(count!= 80);// end of do_while loop
          System.out.print("\n");
     private void printList(ArrayList<TaxPayerRecord> list)
          System.out.println("List of Tax Payers fpr Year 2006");
               for (int i=0; i<list.size(); i++)
               System.out.println((i+1)+") "+list.get(i)+"|"+tax(i,list)+"\n");
     private void printSummary(ArrayList<TaxPayerRecord> list)
               total(list);
               totalAge(list);
               totalDistrict(list);
     private void search(ArrayList<TaxPayerRecord> list,Scanner input)
               String nric;
               int value;
               System.out.print("Enter NRIC Number: ");
               nric = input.next();
               Collections.sort(list);
               value = Collections.binarySearch(list,nric);
     public static void main(String [] args)
               new TaxPayerProgramme();
I keep getting this message:
C:\Documents and Settings\Xiong\Desktop\TaxPayerProgramme.java:285: cannot find symbol
symbol : method binarySearch(java.util.ArrayList<TaxPayerRecord>,java.lang.String)
location: class java.util.Collections
               value = Collections.binarySearch(list,nric);
               ^
1 error
Tool completed with exit code 1

You can't search a list of TacPayerRecords using a String.

Similar Messages

  • Apex 4 , problem with collection executions

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • Refresh problem with collection

    Hello, apologize my English, I have got problem with refresh collections. Follow:
    1) I have got two classes which have got dependency together.
    2) First class has got collection of objects from second class.
    3) I call query "findXXX" which fill collection first class.
    4) I create new object second class and again call query "findXXX" to get actual collection. But collection contain old values a I have to close and open web browser to get actual data.
    I think It is problem with TopLink cache, but I do not know how solve this.
    Can you help me, please?

    The cached data is probably stale.
    There are many ways to solve this. (see the caching section of the docs)
    - there is a refresh option on the query
    - you can set a descriptor to be isolated (Cache.shared=false)
    - you can set a descriptor to always refresh
    - there is a cache invalidation option on descriptor
    - there is a cache synchronization option on session
    If the cache is stale, but the database was not accessed outside the application, it may be that your application is not maintaining relationships correctly. You must ensure you set both sides of a bi-directional relationship.
    -- James : http://www.eclipselink.org

  • Problem with Collective billing

    Hi,
    I have problem doing collective billing for one of my sales order that consist of 2 item, one is a TAN and the other is a TAS. Because of the different business process, i have to combine the billing of a delivery note (for the TAN item) and the sales order (for the TAS item) into one invoice. However when i do so, i end up with 2 invoices. Pls advise.
    Just wondering if the BlCat is different, can the invoice be combine?

    Hi,
    Invoice split will happen if you have any of the following values are different.
    1.Payer
    2. Inco Terms
    3. Payment Terms
    4. Shipping Condition
    5.Country
    6.Transportation Group
    7. Exchange Rate
    Click on the Split analysis.You will come to know why the splitting is happening.
    The procedure for this split analysis is:
    Goto the T.Code "VF02".
    Enter the number of the first billing document that you want to compare. Click on  Environment --> Split analysis.
    Enter the number of the second billing document which you want to compare to the first in the dialog box given.
    Click on "Continue".
    The system displays the Billing document split analysis log.
    Regards,
    Krishna.

  • Need Help With Collection.binarySearch ! Please help me

    * TaxPayerRecord.java
    * Created on December 21, 2006, 11:42 AM
    public class TaxPayerRecord implements Comparable <TaxPayerRecord>
        private String nric;
        private String name;
        private String dateOfBirth;
        private String gender;
        private String blockNo;
        private String unitNo;
        private String streetName;
        private String bldgName;
        private String postalCode;
        private long totalIncome;
        private long totalDonation;
        private long totalPersonalRelief;
         * Creates a new instance of TaxPayerRecord
        public TaxPayerRecord(String nric, String name, String dateOfBirth, String gender,
                                 String blockNo, String unitNo, String streetName, String bldgName,
                                 String postalCode, long totalIncome, long totalDonation,
                                 long totalPersonalRelief)
            this.nric = nric;
            this.name = name;
            this.dateOfBirth = dateOfBirth;
            this.gender = gender;
            this.blockNo = blockNo;
            this.unitNo = unitNo;
            this.streetName = streetName;
            this.bldgName = bldgName;
            this.postalCode = postalCode;
            this.totalIncome = totalIncome;
            this.totalDonation = totalDonation;
            this.totalPersonalRelief = totalPersonalRelief;
        public String toString()
            return nric+"|"+name+"|"+dateOfBirth+"|"+gender+"|"+blockNo+"|"+unitNo+"|"+streetName+"|"+
                   bldgName+"|"+postalCode+"|"+totalIncome+"|"+totalDonation+"|"+
                   totalPersonalRelief;
        public long getTotalIncome()
            return totalIncome;
        public long getTotalDonation()
            return totalDonation;
        public long getTotalPersonalRelief()
            return totalPersonalRelief;
        public String getDateOfBirth()
            return dateOfBirth;
        public String getPostalCode()
            return postalCode;
        public int compareTo (TaxPayerRecord next)
              return this.nric.compareTo(next.nric);
    } //TaxPayerRecord
    import java.io.*;
    import java.util.*;
    public class TaxPayerProgramme
         public TaxPayerProgramme()
                             String menu = "Options: \n"
                                            + "1. Compute And Print List Of Tax Payers (Sorted by NRIC) \n"
                                            + "2. Compute And Summary Of Tax Revenue \n"
                                            + "3. Search for Tax Payer by NRIC \n"
                                            + "Enter option(1-2,0 to quit): ";
                             System.out.print(menu);
                             Scanner input = new Scanner( System.in );
                             int choice = input.nextInt();
                             System.out.println("");
                         // Declaration
                             ArrayList<TaxPayerRecord> list = new ArrayList<TaxPayerRecord>();
                             String inFile ="TaxPayer2005.txt";
                             String line = "";
                             String nric;
                             String name;
                             String dateOfBirth;
                             String gender;
                             String blockNo;
                             String unitNo;
                             String streetName;
                             String bldgName;
                             String postalCode;
                             long totalIncome;
                             long totalDonation;
                             long totalPersonalRelief;
                        try{
                             //Read from file
                             FileReader fr = new FileReader (inFile);
                             BufferedReader inFile1= new BufferedReader (fr);
                             line=inFile1.readLine();
                                       while (line!=null)
                                       StringTokenizer tokenizer = new StringTokenizer(line,"|");
                                       nric=tokenizer.nextToken();
                                       name=tokenizer.nextToken();
                                       dateOfBirth=tokenizer.nextToken();
                                       gender=tokenizer.nextToken();
                                       blockNo=tokenizer.nextToken();
                                       unitNo=tokenizer.nextToken();
                                       streetName=tokenizer.nextToken();
                                       bldgName=tokenizer.nextToken();
                                       postalCode=tokenizer.nextToken();
                                       totalIncome=Long.parseLong(tokenizer.nextToken());
                                       totalDonation=Long.parseLong(tokenizer.nextToken());
                                       totalPersonalRelief=Long.parseLong(tokenizer.nextToken());
                                       TaxPayerRecord person = new TaxPayerRecord(nric,name,dateOfBirth,gender,blockNo,unitNo,
                                                                                              streetName,bldgName,postalCode,totalIncome,
                                                                                              totalDonation,totalPersonalRelief);
                                       list.add(person);
                                       line=inFile1.readLine();
                                       }//end while
                              inFile1.close();
                             }// end try
                        catch (Exception e)
                              e.printStackTrace();
                        }//end catch
                        do{
                                  switch(choice)
                                       case 0:
                                       System.exit(0);
                                       break;
                                       case 1:
                                       // run list
                                       printList(list);
                                       break;
                                       case 2:
                                       printSummary(list);
                                       break;
                                       case 3:
                                       search(list,input);
                                       break;
                                  }//end switch
                             System.out.print(menu);
                             choice = input.nextInt();
                             System.out.println("");
                             }// end do
                             while(choice !=0);
                             Collections.sort(list);
         }//end TaxPayerProgramme()
         private void total(ArrayList<TaxPayerRecord> list)
              // Declaration
              double total=0;
              // calculate total
                   for (int i=0; i<list.size(); i++)
                   total=+ tax(i,list);
              //print msg
              System.out.println("Total revenue collectable for year 2006 (S$): "+total+"\n");
         private double tax(int i,ArrayList<TaxPayerRecord> list)
              // Declaration
              double income;
              double tax;
              // calculate income
              income =list.get(i).getTotalIncome()-list.get(i).getTotalDonation()
                        -list.get(i).getTotalPersonalRelief();
              // calculate tax
                   if (income>320000)
                        tax=(((income-320000)*0.21)+44850);
                   else if (income>160000)
                        tax=(((income-160000)*0.18)+16050);
                   else if (income>80000)
                        tax=(((income-80000)*0.145)+4450);
                   else if (income>40000)
                        tax=(((income-40000)*0.0875)+950);
                   else if (income>30000)
                        tax=(((income-30000)*0.0577)+375);
                   else
                        tax=((income-20000)*0.0577);
              return tax;
         private void totalAge(ArrayList<TaxPayerRecord> list)
                   // Declaration
                   String msg;
                   int i,age;
                   double grp1=0;
                   double grp2=0;
                   double grp3=0;
                   double grp4=0;
                   // calculate revenue by age
                        for (i=0; i<list.size(); i++)
                        age= 2006- Integer.parseInt(list.get(i).getDateOfBirth().substring(6,list.get(i).getDateOfBirth().length()));
                        if (age>55)
                             grp4 =+ tax(i,list);
                        else if (age>35)
                             grp3 =+ tax(i,list);
                        else if (age>17)
                             grp2 =+ tax(i,list);
                        else
                             grp1 =+ tax(i,list);
                   //print msg
                   msg="Total revenue by age range (S$) \n"+
                        "\t"+"(1 to 17)"+"\t"+ grp1 +"\n"     +
                        "\t"+"(18 to 35)"+"\t"+ grp2 +"\n"     +
                        "\t"+"(36 to 55)"+"\t"+ grp3 +"\n"     +
                        "\t"+"(above 55)"+"\t"+ grp4 +"\n";
                   System.out.println(msg);
        private void totalDistrict(ArrayList<TaxPayerRecord> list)
                   int count=1;
                   double temp=0;
                   double [][] array = new double [list.size()][2];
                        for (int i=0; i<list.size(); i++)
                        array[0]=Double.parseDouble(list.get(i).getPostalCode().substring(0,2));
                        array[i][1]=tax(i,list);
                   System.out.println("Total revenue by district (S$) ");
                        do{
                                  for (int a=0; a<list.size(); a++)
                                       if (count == array[a][0] )
                                       temp=array[a][1];
                                  }//end for loop
                             System.out.print("\t"+"(district "+count+")"+"\t"+ temp +"\n");
                             temp=0;
                             count++;
                        }while(count!= 80);// end of do_while loop
              System.out.print("\n");
         private void printList(ArrayList<TaxPayerRecord> list)
              System.out.println("List of Tax Payers fpr Year 2006");
                   for (int i=0; i<list.size(); i++)
                   System.out.println((i+1)+") "+list.get(i)+"|"+tax(i,list)+"\n");
         private void printSummary(ArrayList<TaxPayerRecord> list)
                   total(list);
                   totalAge(list);
                   totalDistrict(list);
         private void search(ArrayList<TaxPayerRecord> list,Scanner input)
                   int value;
                   System.out.print("Enter NRIC Number: ");
                   String nric = input.next();
                   Collections.sort(list);
                   value = Collections.binarySearch(list,nric);
         public static void main(String [] args)
                   new TaxPayerProgramme();
    Can someone help me with this?
    I can't find the error.
    The error msg display:
    C:\Documents and Settings\Xiong\Desktop\TaxPayerProgramme.java:285: cannot find symbol
    symbol : method binarySearch(java.util.ArrayList<TaxPayerRecord>,java.lang.String)
    location: class java.util.Collections
                   value = Collections.binarySearch(list,nric);
                   ^
    1 error
    Tool completed with exit code 1

    Well, this is the error, Java6 gives me on your code:The method binarySearch(List< ? extends Comparable<? super T> >, T) in the type Collections
    is not applicable for the arguments (ArrayList<TaxPayerRecord>, String)     The method expects the first parameter, to be a List whose children are Comparable to the second parameter. Your second parameter is String, so the List should be on String not on TaxPayerRecord, or, your second parameter should be a TaxPayerRecord and not a String.
    �dit: Another thought. From the error code you posted, I would assume, that you might have the wrong JDK libraries in your path.

  • Hi i have some problem with collect statement.

    hi when i am using collect statement and whn ever any field is modified it is getting doubled and showing doubled value. may i knoe what would be problem.

    Hai Kumar
    Go through the following Collect Syntax
    COLLECT
    Basic form
    COLLECT [wa INTO] itab.
    Addition
    ... SORTED BY f
    Effect
    COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
    If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
    If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
    If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
    If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
    After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.
    Notes
    COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.
    If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that
    the internal table will actually be unique or compressed, as described above and
    COLLECT will run very efficiently.
    If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.
    Example
    Compressed sales figures for each company
    DATA: BEGIN OF COMPANIES OCCURS 10,
            NAME(20),
            SALES TYPE I,
          END   OF COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 10.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Tiger'. COMPANIES-SALES = 20.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 30.
    COLLECT COMPANIES.
    The table COMPANIES now has the following appearance:
    NAME SALES
    Duck 40
    Tiger 20
    Addition
    ... SORTED BY f
    Effect
    COLLECT ... SORTED BY f is obsolete and should no longer be used. Use APPEND ... SORTED BY f which has the same meaning.
    Note
    Performance
    The cost of a COLLECT in terms of performance increases with the width of the default key needed in the search for table entries and the number of numeric fields with values which have to be added up, if an entry is found in the internal table to match the default key fields.
    If no such entry is found, the cost is reduced to that required to append a new entry to the end of the table.
    A COLLECT statement used on a table which is 100 bytes wide and has a key which is 60 bytes wide and seven numeric fields is about approx. 50 msn (standardized microseconds).
    Note
    Runtime errors
    COLLECT_OVERFLOW : Overflow in integer field when calculating totals.
    COLLECT_OVERFLOW_TYPE_P : Overflow in type P field when calculating totals.
    Thanks & regards
    Sreenivasulu P

  • Problems with collective search help

    Hello SDNers,
    I was working with collective search help.
    Ex : zc_srch1 (Collective)
    In the 'Include search help' i have included 2 search elementary search
    help
    Ex : zsrc1 and zsrc2 (both elementary)
    I have also assigned the parameter assignment for each included search help.
    I have also mentioned the search help parameter under definition tab
    Ex field form zsrch1 and field1 from zsrch2
    and also checked the import and export checkboxes.
    Now i have used the search help in the abap program
    ex: tmp type field1 matchcode object zc_srch1.
    Now when i execute the program the collective search help is getting populated.  when i try to choose a value it is not getting selected to the parameter box.
    Regards,
    Ranjith N

    Hi,
    Once again check back your seach help creation by following the link below.
    http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
    Cheers!!
    VEnk@

  • Problem with collection names getting replaced when creating new collections in Photoshop Elements 5.0

    We have been using Photoshop Elements 5.0 a lot lately to organize many photos into collections.  A new problem just arose when creating a new collection.
    As we named the new collection and clicked on "OK" it replaced another existing collection with the new name.  The photos from the old collection were still there but now under the new collection name.  This happened at least three or four times, each time a different "old" collection was renamed.  Does anyone know why this would happen?
    This past week we have added at least 20 new collections with no problem prior to this.  Adobe actually had to shut down when this happened.  Each time we reopened Adobe it would happen again randomly renaming a different "old" collection when we tried to add the new one.  Any insights would be much appreciated.

    Thank you - that was the problem and now it is working correctly
    again!
    Tom Z.
    >>> saurabh288 <[email protected]> 05/24/09 4:23 AM >>>
    It may be that the catalog has been corupted.Try repairing the
    catalog of PSE.

  • Problems with Collections

    I downloaded the Demo of Lightroom yesterday and have been experimenting with it. I've created various collections, and had no problem dragging pictures into them. I was dragging some pictures into a collection this afternoon, and somehow, the entire library got selected. So I deselected everything, and now I can no longer drag pictures into the collections. I think I'm suppose to be able to drag pictures to rearrange them in the thumbnail window, but I can't do that either. I also can't rearrange pictures in the collections. If I select multiple pictures, the 1st one is highlighted brighter than all the other ones. I've restarted Lightroom multiple times, I've restarted the computer, I threw away the only preference file I could find for Lightroom (com.adobe.Lightroom.plist), and I've tried re-installing Lightroom. I'm totally stumped. Anybody have any ideas?
    thanks
    Mac 10.4.8, 2 gigs of ram, PowerPC iMac

    > Of course, now I have read what the answer is - selecting the picture and not the border - it is soooo obvious.
    Thats funny, because I had the same problem, but in the opposite way.
    Normally in windows, when you Shift-Click or Ctrl-Click to select
    multiple items, and then if you do a regular click on one of the items,
    the rest of the items will be deselected. Well, I've been suffering from
    the problem of it NOT behaving like that. It's kind of annoyed me, but I
    just do a Ctrl-D (deselect all) and then click. Now that I read your
    post, I realize that if I click on the border instead of the picture, it
    WILL behave the way I expect it.
    I don't know how Mac user interfaces should behave, but in windows, if
    you have multiple selections, then a normal click without a drag will
    deselect everything except the item you clicked, but if you press the
    mouse button and start dragging before you release the button, it's NOT
    treated as a deselect. It is treated as a drag and drop. If you drop it
    onto something that doesn't make sense (like dropping it onto the
    filmstrip) then it leaves everything just the way it was and pretends
    like you never clicked anything. That would be the proper way to do it
    to be consistant with Windows interface standards.
    Of course, being able to click within a selection without deselecting
    everything else has advantages too. For instance, if you select a bunch
    of images, you can then go through them and choose the one you intend to
    be your primary selection for purposes of syncing settings or metadata.

  • Problem With Collection

    I am having problems populating a collection.
    I have created my collection on page load of Page 7 using
    BEGIN
    apex_collection.create_or_truncate_collection
      (p_collection_name => 'PEOPLE');
    END;The user then clicks on the "Copy" button that takes them to Page 13.
    It is here that I am trying to populate my collection, by clicking the Add link in the People report.
    for x in (select * from gus_people_2 where id = :P13_ID)
    loop
      apex_collection.add_member(p_collection_name => 'PEOPLE',
        p_c001 => x.id,
        p_c002 => x.rank,
        p_c003 => x.first_name,
        p_c004 => x.surname,
        p_c005 => x.dob,
        p_c006 => x.job,
        p_c007 => x.disp_seq);
    end loop;Once added, the member of the collection should appear in the Populated Collection report.
    select c001, c002, c003, c004, c005, c006, c007, 'Remove' remove
    from apex_collections
    where collection_name = 'PEOPLE'I am using Apex 4.1 on the Oracle web site
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: GUSCRIGHTON
    Username : [email protected]
    Password: terminator
    Application Name: EXCEL_UPDATE_TEST
    Same username and password as above.
    It is probably something really obvious, but I cannot spot it today.
    Any help appreciated.
    Gus

    hI gUS,
    Now run your page, it will work,.
    Thanks,
    Loga
    Add Collection Process
    Request =exp1
    'ADD' - removed single quotation
    Remove Collection process
    Request =exp1
    DEL - I have given this string.
    Later you will add with link or button .
    Edited by: Logaa on May 18, 2012 6:04 AM

  • Problems with Collections using, HTMLDB_COLLECTIONS

    Hello everybody,
    I get strange problemss using the HTMLDB_COLLECTION. I want my collection to hold temporary data before the final insert or update processes. I have this list of persons with their name, phone number and phione extension number. This is quite simple and it works well on my form A. I have no problems, I can update, add, delete without any trouble.
    The content of my collections are showed in a status region. To edit the collection, I call a popup to fill the data. I can do all the operations there. But now I have a Form B which is an other version of FORM A, it's using the same code and popup window to alter the collections's information. But for a reason I do not understand. It's not working at all. It's the same popup page who is calling :
    HTMLDB_COLLECTION.DELETE_MEMBER(
    p_collection_name => collection name,
    p_seq => member sequence number);
    HTMLDB_COLLECTION.ADD_MEMBER(
    p_collection_name => collection name,
    p_c001 => [member attribute 1],
    p_c002 => [member attribute 2],
    p_c003 => [member attribute 3],
    p_c004 => [member attribute 4],
    p_c005 => [member attribute 5],
    p_c006 => [member attribute 6],
    p_c007 => [member attribute 7],
    p_c050 => [member attribute 50]);
    p_clob001 => [CLOB member attribute 1],
    p_generate_md5 => YES or NO);
    HTMLDB_COLLECTION.UPDATE_MEMBER (
    p_collection_name => collection name,
    p_seq => member sequence number,
    p_c001 => member attribute 1,
    p_c002 => member attribute 2,
    p_c003 => member attribute 3,
    p_c004 => member attribute 4,
    p_c005 => member attribute 5,
    p_c006 => member attribute 6,
    p_c007 => member attribute 7,
    p_c050 => member attribute 50);
    p_clob001 => [CLOB member attribute 1],
    etc ...
    If this works for page A, why it doesn't work for page B, when both pages use the same collections and popup window ?
    Thank you for your help.
    leinadjan
    Edited by: user13047323 on 2010-04-27 11:31

    Chantale,
    One thing jumped out at me there, that you might want to double-check -
    HTMLDB_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    p_collection_name => 'ApprobateurSelect',
    p_query => 'select approbateur.PEIN,
    approbateur.niveau_approbation,
    groupe.code_groupe
    from approbateur, usager, groupe
    where APPROBATEUR.PEIN = USAGER.PEIN
    AND approbateur.code_tache = :12_CODE_TACHE_HIDDEN');Is your item really called 12_CODE_TACHE_HIDDEN? Or should that be P12_CODE_TACHE_HIDDEN?
    If that item name is correct, then I would actually put the query itself into a variable, just so that it's easier on the eye to read and make sure there are no error in the query itself (can you run it from SQLPlus etc), then pass the variable into the CREATE_COLLECTION_FROM_QUERY_B procedure instead.

  • Problem With Collection Sets

    Wow, I am really regretting upgrading from v1.  What used to be simple catalogueing tasks are now so frustrating, long winded and unreliable my temper is being tested daily.
    I regularly photograph either similar events or the same annual events and like to organise my photos into collections, sub collections etc.  For a new event once I have got the structure of collections set up in my mine catalogue I was then able to export this as a new catalogue to use as a template for future events.  I started doing this as a result of great advise on this forum, as a work around for not being able to copy collection structures within a catalogue.  The result was I didnt need to keep setting up a structure of many collections for each event, I could use the template catalogue and import this into the main one when the photos were organised.
    So then I moved to Lightroom 3
    First I found that with the introduction of collection sets I could no longer have nested collections and had to use nested collection sets with only the final level as a collection.  A pain in the neck and one which meant my exisiting catalogue needed weeks of work to correct, in addition to an alteration to my workflow which still isnt ideal.
    Because of this I have now been trying to exprot my revised structure of collections and collection sets as new templates for the reasosn mentioned above.  But I can't becuase lightroom does not allow exporting collection sets, only collections i.e. one level, meaning this great workaround is no longer available.
    So I thought what I would do is copy my catalogue, delete everything in it but the collection set structure I wanted for each event, and then use this as a template.  Very time consuming but hopefully it would solve the problem.  But it didn't as when I import the catalogue there seems to be a limit as to the number of collection set levels that get imported, meaning the lowest levels and hence the collections dont import, i.e. all the organisation is pointless as the photos import but not the collections.
    So I thought OK I would move one of the collection sets from its parent to the top level and get around it this way, meaning I just have to do a little reorganisation after importing it.  Not ideal, but hopefully it would solve the problem.  Guess what, it doesnt.  I move the collection set (and with it all its child sets and collections) to the top, and when I delete the collection set which used to be the parent, all the child sets and collections disappear from the new top level set.
    Thsi is so frustrating.  In 20 years of using software I have never before experienced a product that removes / fundamentally changes the way in which it works so drastically as this.
    If anyone has any ideas how I can get around this I'd really appreciate it

    Hello,
    Please refer to the following article.
    http://blogs.msdn.com/b/sqlagent/archive/2011/07/22/remove-associated-data-collector-jobs.aspx
    You can run the dcclenaup.sql script mentioned in the article.
    Another option is using sp_syscollector_cleanup_collector.
    http://blogs.msdn.com/b/sqlagent/archive/2012/04/05/remove-associated-data-collector-jobs-in-sql-2012.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Problem with collections

    hello all,
    i am getting the systex error (multiple markers at the line 3)
    from the following code, (i am using java 1.5 and eclipse 3)
    import java.util.*;
    public class FindDups {
        public static void main(String args[]) {
            Set <String> s = new HashSet<String>(); //ine 3
            for (String a : value){
                if (!s.add(a))
                    System.out.println("Duplicate detected: "+a);
            System.out.println(s.size()+" distinct words detected: "+s);
    }thanks
    daya

    thanks for replay,
    values come from command line (command line parameter)
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         Syntax error on token "<", invalid AssignmentOperator
         Syntax error on token "=", != expected
         Syntax error on token "<", ( expected
         Syntax error on token "(", invalid Expression
         Syntax error on token(s), misplaced construct(s)
         Syntax error on token ")", : expected
         at collection.FindDups.main(FindDups.java:18)

  • Problem with Collect statement

    Hi Experts,
    I am facing a peculiar problem. Please go through the code below and it is not giving the aggregate of it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.
    LOOP AT it_ekbe_642_pgi.
        it_ekbe_642_pgi_tot-ebeln =   it_ekbe_642_pgi-ebeln.
        it_ekbe_642_pgi_tot-ebelp =   it_ekbe_642_pgi-ebelp.
        it_ekbe_642_pgi_tot-budat =   it_ekbe_642_pgi-budat.
        it_ekbe_642_pgi_tot-xblnr =   it_ekbe_642_pgi-xblnr.
        it_ekbe_642_pgi_tot-menge =   it_ekbe_642_pgi-menge.
        COLLECT it_ekbe_642_pgi_tot.
      ENDLOOP.
    Please suggest.
    Thanks....
    Shibaji.

    Hi Shibaji Maitra ,
    Since you are aggregating the it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.
    For using the Collect statement the order of the fields should be
    in proper order i.e. all the char fields come up & then after that
    all the numeric fields.Please check the sequence in your internal
    table and also the fields type of menge field.
    LOOP AT it_ekbe_642_pgi.
      it_ekbe_642_pgi_tot-ebeln = it_ekbe_642_pgi-ebeln.
      it_ekbe_642_pgi_tot-ebelp = it_ekbe_642_pgi-ebelp.
    it_ekbe_642_pgi_tot-xblnr = it_ekbe_642_pgi-xblnr.
    it_ekbe_642_pgi_tot-budat = it_ekbe_642_pgi-budat.
    it_ekbe_642_pgi_tot-menge = it_ekbe_642_pgi-menge.
    COLLECT it_ekbe_642_pgi_tot.
    ENDLOOP.
    Rewards points if helpful.
    Regards
    Manoj Kumar

Maybe you are looking for

  • Unknown column name: annee

    Hi, I have a error message. My request is good but in my program java, annee is a unknown column name. SELECT DISTINCT round(wbdate/10000,0) AS annee FROM EUROF400.FICLIB.IE02 WHERE WBETAT=:etat ORDER BY annee DESC String l_annee=mod.getIe0211().getB

  • How do I allow zooming on a page, but return all pages to 100% zoom after leaving that page?

    When I access a webpage and zoom in on content, if I leave the page and return in the same browsing session, the page is still zoomed in. How do I stop Firefox from storing the zoom data so a page will always start on the default zoom level, without

  • I cannot open a recent item. Is it lost forever?

    I had an important document that my MacBook autosaved for me, so I opened the autosaved version and began editing it extensively, after finalizing it I (stupidly) saved it under the same autosave name. Now my document folder is only displaying the or

  • Dreamweaver CS3 Freezes on Mouseclick!

    Okay, I've looked into this problem for over two hours and am very disappointed in the development team at Adobe. I have tried a number of things to try and fix the problem, but nothing works! I open a .php file in code view in DW, and when I select

  • Link to open up in new browser window

    Hi everyone, I need a link to open up in a new browser window but don't want to use the target attribute as it's deprecated. Can someone tell me if Dreamweaver has any built-in javascript behaviours that will do this for me? Appreciate any help.