Eliminating the duplicated values

Hi,
I have an array and i am filing this array with values which comes from defined function and these values are some time duplicated.
can any one tell me how can i eliminate them?
hope to hear from you.
Best regards
Yasir Noman

Hi Yasir,
What about using Hashtable instead?
Regards,
Marc

Similar Messages

  • Eliminating the null values from popup list item

    Dear All,
    i create a popup list,at runtime it shows a null blank value among the values i specified while the combo box is not,
    i want to eleminate the blank null value from the popup list.
    Need Help.
    Thanks & Regards.

    Okay,
    i create a popup list, populate it in runtime with create_group_from_query builtin.
    now when i run the form and click the list item, it display a null value among the other values which are
    return from the create_group_from_query .
    the procedure is below
    procedure Department_proc is
    rg recordgroup;
    n number;
    begin
    remove_record_group('RG');------  this is another procedure which checks for Record group existance and remove it.
    rg=:=create_group_from_query('RG4','SELECT NAME,TO_CHAR(DEPT_ID) FROM TAB_DEPT_SECTION
    UNION
    SELECT '||'''All Departments'''||'as name,'||'''0'''||' as name from dual');
    n:=populate_group(rg4);
    populate_list('control_block.department',rg4);
    end;
    it display a null value among the other values for the first time is run the form,but when i click it and select a value from it
    and the onward click dont show the null value.i want to eleminate the null value even for the first time when the user run the
    from.
    Best Regards

  • How eliminating duplicated values from selecItem's List...

    Hi guys,
    i've a problem.
    I've a list of selectItem elements.
    private List<SelectItem> names;
    filled with some values.
    In this values there are some duplicated values, so i need to eliminate them.
    How can i do it?
    Please help me,thanks

    thanks very much...
    but i have a problem.
    I need to use ArrayList.
    What i want now is creating a Set and copying in it the arraylist....it should work???
    I've tried in this manner
    Once i've created the arrayList names
    i've defined
    private Set<SelectItem> names2;and i've done
    names2=new HashSet();
    names2.addAll(names);calling in my page names2.
    The problem is that it shows me the same list, with changed order, but without eliminating duplicated values.
    Can you help me?

  • Duplicated values when added to list of list

    Hey all,
    I'm making a list of lists, when I print the values just after adding in the list of list everything seems fine, but when I print that list where I call it it has duplicate value instead of the 2 different that I see when I first print it, I really don't know what's wrong.
    I tried 2 different declarations for the list of list but is the same result, I also tried using index to add the list but no change either.
    What is wrong? or how should I do it instead.
    Thanks in advance
    The code is this
    public class ReadFile extends Metrics{
        public List loadFile(String filename) throws IOException{//void
            FileInputStream fstream = null;
            ///TRACE POINTS
                List<TracePoint> CharPoints=new ArrayList<TracePoint>();
                List<List> ListaChars = new ArrayList<List>();
                //List<List<TracePoint>> ListaChars = new ArrayList<List<TracePoint>>();
            try {
                fstream = new FileInputStream(filename);//"xy.dat");
                DataInputStream in = new DataInputStream(fstream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String strLine;
                Normalize norm = new Normalize();
           //Read File Line By Line
                while((strLine = br.readLine())!= null) {
                    int INDEX=0;
                    ///READING VALUES FROM XY FILE and splittting
                    String[] temp = strLine.split(" ");
                    ///clear list before reusing it
                    CharPoints.clear();
                    String[] tempNorm = norm.normalize(temp, 0, 1);
                    for (int i = 1 ; i < tempNorm.length ; i=i+2){
                        CharPoints.add(new TracePoint(Float.parseFloat(tempNorm),Float.parseFloat(tempNorm[i+1])));
    ListaChars.add(INDEX, CharPoints);
    System.out.println(" Charpoints is "+ CharPoints);
    System.out.println(" LISTofCHARS is "+ ListaChars);
    INDEX++;
    //Close the input stream
    in.close();
    }catch (FileNotFoundException ex) {
    Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex);
    }finally {
    try {
    fstream.close();
    } catch (IOException ex) {
    Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex);
    //return CharPoints;
    return ListaChars;
    public static void main(String args[]) throws IOException{
    ReadFile test2 = new ReadFile();
    List<List> characters = new ArrayList<List>();
    characters = test2.loadFile("xy.dat");
    //System.out.println("\ncharacters = " +" "+ characters.get(0));
    The result is this, the first look like its copying ok, but when the second is added is duplicated and the first value is not there anymoreCharpoints is [TracePoint: 0.395683, 0.913669, 0.000000, TracePoint: 0.136691, 0.928058, 0.000000, TracePoint: 0.000000, 1.000000, 0.000000]
    LISTofCHARS is [[TracePoint: 0.395683, 0.913669, 0.000000, TracePoint: 0.136691, 0.928058, 0.000000, TracePoint: 0.000000, 1.000000, 0.000000]]
    Charpoints is [TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000]
    LISTofCHARS is [[TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000], [TracePoint: 1.000000, 0.004096, 0.000000, TracePoint: 0.999937, 0.003151, 0.000000, TracePoint: 0.999811, 0.001765, 0.000000, TracePoint: 0.998866, 0.000000, 0.000000]]
    Edited by: mtiv on Oct 24, 2009 6:02 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    while((strLine = br.readLine())!= null) {
                    int INDEX=0;
                    INDEX++;
    }On each iteration of the while loop, index equals 0. Try moving the variable index outside of the while loop.
    List<TracePoint> CharPoints=new ArrayList<TracePoint>();By convention variable names begin with a lower case letter, it is an important practise to live by as I was lead to believe CharPoints was a class at first.
    Mel

  • How to delete the duplicated records, not just surpress the records?

    I am new to CR. Right now I am doing a project which needs CR get query from Oracle. I got the query from Oracle. There are records with duplicated fields. For example (the following only show part of fields):
    ID    body_code  
    1            10            
    2             10            
    3             15            
    4              15           
    5              15           
    6              16           
    I need to only select records (not surpress, because I will do some caluculate later) like following:
    ID         body_code        
    1             10         
    2              15
    3               16   
    I tried to creat selection fomula in fomula workshop, shown as follows:
    onlastrecord;
    <>next
    but CR said next can be evaluated. I think it must have something to do with the print-time. So what show I do to delete the duplicated records.Thank you very much.

    Ting,
    Try this:
    Insert a group on body_code.  Then create a running total called Distinct Count.  Field to summarize -> ID, Evaluate on change of group Group # 1 Body Code, and Never Reset.
    Then insert a chart in the report header:
    In the advanced layout, select body_code on change of and select Distinct Count running total in the Show values.
    I hope I understood what you're looking to accomplish.
    Z

  • How do I set the default value to 0 in a property with "money" as the type?

    I have an entity with several properties with the "Money" data type.  I also have a Money property with a "computed" value that shows the sum of the other money type properties. However, a total will not display if any of the other
    fields are left with a null value. Is there way to make the default value set to "0"?  I am using c#.  Thank you.

    Mark, there's a very basic .NET method on every nullable object:
    GetValueOrDefault
    EDIT: Now I see...please avoid duplicating
    questions...
    To be clear:
    Put GetValueOrDefault on every nullable field used inside your 'TotalDue_Compute' sub
    You don't need to define 'TotalDue' as Nullable anymore

  • Duplicated values

    i want to display employee last names, department numbers, and all the employees who work in the same department as a given employee.The tables are like this
    departments
    Name Null? Type
    DEPARTMENT_ID NOT NULL NUMBER(4)
    DEPARTMENT_NAME NOT NULL VARCHAR2(30)
    MANAGER_ID NUMBER(6)
    LOCATION_ID NUMBER(4)
    desc employees
    Name Null? Type
    EMPLOYEE_ID NOT NULL NUMBER(6)
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(25)
    PHONE_NUMBER VARCHAR2(20)
    HIRE_DATE NOT NULL DATE
    JOB_ID NOT NULL VARCHAR2(10)
    SALARY NUMBER(8,2)
    COMMISSION_PCT NUMBER(2,2)
    MANAGER_ID NUMBER(6)
    DEPARTMENT_ID NUMBER(4)
    output format is something like this
    department employee colleague
         20          fay          hartstein
         20     hartstein Fay
    50 davies matos
    and so on..
    i am getting duplicated values. I got 3530 rows.i am having 107 rows in employees and 33 row in department

    You have what is know an a cartesion product.
    SQL> select 107 * 33 from dual;
        107*33
          3531You need to Join
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/queries7.htm#2054014

  • What is the Parameter values for passing a password to open a pdf

    I need help in finding the Parameter values for passing a password to open a pdf(s)? The software is written in Delphi.

    The Copy Protection only protects our Disk from being duplicated and also protects our Software from being copied and used locally.
    As far as the password encryption, that is why I created the Post. I was hoping that the password can be coded in our Software to open the password protect PDF that we create. This option would of gave us the security for when the customer copies the pdf to there local drive they would be required to input the password which they would not have access to.

  • Unable to capture the parameter values from a PL/SQL procedure

    hi.
    i'm trying to capture the parameter values of a PL/SQL procedure by calling inside a anonymous block but i'm getting a "reference to uninitialized collection error" ORA-06531.
    Please help me regarding.
    i'm using following block for calling the procedure.
    declare
    err_cd varchar2(1000);
    err_txt VARCHAR2(5000);
    no_of_recs number;
    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
    cntr_var number:=0;
    begin
         rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
         dbms_output.put_line('The error is ' ||err_cd);
         dbms_output.put_line('The error is ' ||err_txt);
         dbms_output.put_line('The cntr is ' ||cntr_var);
         for incr in 1 .. OUT_SIGN_TAB.count
         loop
         cntr_var := cntr_var + 1 ;
    Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN_TAB(incr).txn_type||','||OUT_SIGN_TAB(incr).objid);
    end loop;
    end;
    Error is thrown on "for incr in 1 .. OUT_SIGN_TAB.count" this line
    Following is some related information.
    the 3rd parameter of the procedure is a out parameter. it is a type of a PL/SQL table (SEARCH_SIGN_TAB_TYPE) which is available in database as follows.
    TYPE "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
    TYPE "SEARCH_SIGN_TYPE" AS OBJECT
    (ref_no VARCHAR2(22),
    ciref_no VARCHAR2(352),
    ac_no VARCHAR2(22),
    txn_type VARCHAR2(301),
    objid VARCHAR2(1024))............

    We don't have your rt843pq procedure, but when commenting that line out, everything works:
    SQL> create TYPE "SEARCH_SIGN_TYPE" AS OBJECT
      2  (ref_no VARCHAR2(22),
      3  ciref_no VARCHAR2(352),
      4  ac_no VARCHAR2(22),
      5  txn_type VARCHAR2(301),
      6  objid VARCHAR2(1024))
      7  /
    Type is aangemaakt.
    SQL> create type "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
      2  /
    Type is aangemaakt.
    SQL> declare
      2    err_cd varchar2(1000);
      3    err_txt VARCHAR2(5000);
      4    no_of_recs number;
      5    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
      6    cntr_var number:=0;
      7  begin
      8    -- rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
      9    dbms_output.put_line('The error is ' ||err_cd);
    10    dbms_output.put_line('The error is ' ||err_txt);
    11    dbms_output.put_line('The cntr is ' ||cntr_var);
    12    for incr in 1 .. OUT_SIGN_TAB.count
    13    loop
    14      cntr_var := cntr_var + 1 ;
    15      Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN
    TAB(incr).txntype||','||OUT_SIGN_TAB(incr).objid);
    16    end loop;
    17  end;
    18  /
    The error is
    The error is
    The cntr is 0
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • What the Initial value for sy-tabix & sy-index

    Hi Folks
       I have a small doubt.
    What the Initial value for sy-tabix & sy-index?
    Can anyone please clarify me?
    Regards,
    Sree

    hi sree,
    both values are initialized to 0 before processing and after processing values are changed according to used scenarios.
    if helpful reward some points.
    with regards,
    suresh babu aluri.

  • Not able to get the full value from request.getParameter()

    hi all,
    Iam giving a text input value as" Analysis and tracking" in one jsp form.
    while fetching and assigning the value to another variable using request.getparameter , iam getting only the text "Analysis" , the space after it were ignored andnt displaying it.
    Help me in solving this.
    thanx
    Balaji

    I think you are code is something like this
    <input name="xyz" type="text" value=<%=variable%>>
    HTML ignores spaces. Therefore you are only getting Analysis, the first word, when your browser encounters the first space it ignores whatever is present after that.
    One way of overcoming this is putting double quotes around the text value
    <input name="xyz" type="text" value=<% out.println("\"" + variable + "\""); %>
    Thanks.

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can we remove the commas from the Formula value in SAP BW BEx query

    Hi All,
    How can we remove the commas from the Formula value in SAP BW BEx query
    We are using the formula replacing with characteristic.The characteristic value needs to be display as number with out commas.
    Regards
    Venkat.

    Do you want to remove the commas when you run the query on Bex Web or in RSRT?
    Regards

  • I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

    This is most probably because the Periodicity input value has been configured as "Required" and no value has been input for it.
    Please enter a value and try to re-run Quick Pay.

  • Not to display the null values from data base

    Hiiii.
    In a jsp file i have ten check boxes.The jsp file is mapped to a servlet file for parameter requesting and to
    store it in DB.
    The unchecked box values has null values.All the values are store in a Mysql DB table.
    Again i have to display it in a jsp page from table.
    The problem am facing was,how can i display only the values in a row.it must not display the null values and the crresponding column name.
    Or any other way is their like below
    How i can retrieve only the selected check boxes from tht jsp file.and store in backend.
    Thanks in Advance
    regards,
    satheesh kannan

    Here is a rough example that may give you some ideas:
    On the JSP page:
    <%if(myData.getFirstName()!=null){%>
    Your First Name'
    <input type="text" name="firstName" value="<%=myData.getFirstName()%>">
    <%}%>
    In the servlet:
    String firstName= request.getParameter("firstName");
    if(firstName!=null){
    //write it to the database
    }

Maybe you are looking for

  • Empty System Fields after error creates a short dump

    Hello! Could someone please help me? After calling a function, I catch errors with sy-subrc NE 0. Handling this error the "normal" way throws a short dump (I marked the row bold), because all the system fields are empty! Could someone please give me

  • DMS: Print mutiple Documents(originals)  through CV04n List of DIRS directl

    Hi All, Is it possible to Print Multiple documents through cv04n list of douments, i.e i will select the documents from the list, say 10 documents & click on the print tab. When i tried it prints only the frist document(original), how can print the a

  • Info record change history

    Hello  Guru, I want to check changes made in info record like change in tax code .Is their any way /Table  to check the same .I have tried Extras-->changes in ME13 but could not get the same.Also their we had to give certain date does it mean that sy

  • HELP!! App 200 error? Cannot click on/select anything on Home Screen/no buttons work.

    I have a BlackBerry Curve 8330 and it's worked great until last night. I kept pulling it out of my pocket and it would be off. And when i would turn it back on, i'd put it back in my pocket to wait for it to start up and when I looked at it again, it

  • Free of delivery

    hi here is a scenario where we have to do free of delivery charges but need to update excise also as we r providing free sample good to the customer from the manufacturing plant which is having excise duty. so can any one help me on this scenario? re