Need advice on preventing duplicate entries in People table

Hi,
In my database, I have a "People" table where I store basic information about people e.g. PersonId, FirstName, LastName, Gender, etc.
There will be lots of entries made into this table and I want to prevent duplicate entries as much as humanly possible. I'd appreciate some pointers on what I should do to minimize duplicates.
My primary concerns are:
Duplicate entries for the same person using the person's full name vs. given name e.g. Mike Smith and Michael Smith
Making sure that two separate individuals with identical names do get entered into the table and get their unique PersonId's.
Not even sure how I can even possibly know if two individuals with identical names are two different people without having additional information but I wanted to ask the question anyway.
Thanks, Sam

Thank you all very much for your responses.
There are three separate issues/points here.
It is clear that it is impossible to prevent duplicates using only a person's first, middle and last names. Once I rely on an additional piece of information, then things get "easier" though nothing is bullet proof. I felt that this was self evident but
wanted to ask the question anyway.
Second issue is "potential" duplicates where there are some variations in the name e.g. Mike vs Michael. I'd like a bit more advice on this. I assume I need to create a table to define variations of a name to catch potential duplicates.
The third point is what Celko brought up -- rather nicely too :-) I understand both his and Erland's points on this as typical relational DB designs usually create people/user tables based upon their context e.g. Employees, Customers, etc.
I fundamentally disagree with this approach -- though it is currently the norm in most commercial DB designs. The reason for that is that it actually creates duplicates and my point is to prevent them. I'm going for more of an object based approach in the DB
design where a person is a person regardless of the different roles he/she may play and I see no reason in repeating some of the information about the person e.g. repeating first, last name, gender, etc in both customer and employee tables.
I strongly believe that all the information that are directly related to a person should be kept in the People table and referenced in different business contexts as necessary.
For example, I assign every person a PersonId in the People table. I then use the PersonId as part of the primary key in the Customers or Employees table as well. Obviously, PersonId is also a foreign key in Customers and Employees tables. This prevents the
need for a separate CustomerId and allows me to centralize all the personal data in the People table.
In my opinion this has three advantages:
Prevent duplication of data
Allow global edits e.g. if the last name of a female employee changes, it is automatically updated for her within the context of "Customer" role she may play in the application.
Last but not least, data enrichment where a person may enter additional data about himself/herself in different contexts. For example, in the employee context, we may have the person's spouse information through "Emergency Contacts" which may come handy
within the context of customer for this person.
Having everyone in the People table gives me these three advantages.
Thanks, Sam

Similar Messages

  • Prevent duplicate entry

    I would like to make sure there are no duplicate data entries in my Oracle 9i table (called MainTable) which has an Id field that is the primary key, ValData with a varchar data type, Fid and Fid2 are number data types.
    Id   ValData   Fid   Fid2
    1    abc       34    2
    2    efg       23    34
    3    zeo       25    43Sometimes someone can enter a duplicate ValData, Fid and Fid2 and it will end up like this:
    Id   ValData   Fid   Fid2
    1    abc       34    2
    2    efg       23    34
    3    zeo       25    43
    4    zeo       25    43What constraints or restrictions can I place on the MainTable where it will never allow a duplicate entry into the table?
    I would like to do this somehow in the database. If someone tries to enter a duplicate I should get a error message or something to indicate an attempt to enter duplicate data.
    Please advise if this is possible?

    We told you above - next level of support is onsite but not sure your zipcode is similar to mine.
    First you have to clarify if the three fields must be uniq as a combination or if valdata alone cannot be duplicated. In other words:
    id valdata fid fid2
    1 abc 34 2
    2 abc 23 34
    is this legal?
    Depending on the answer you apply the appropriate solution. If answer is yes, you apply this:
    alter table <table name> add constraint uniq_combination unique (valdata, fid, fid2);
    if answer is that it is illegal because you want to prevent valdata alone to assume duplicate values, then:
    alter table <table name> add constraint uniq_valdata unique (valdata);
    See Guido's comment above concerning the handling of the DB generated error.
    enrico

  • How to prevent duplicate entry in Details block

    Dear All
    I am using Forms 10g.
    I have a detail block.
    There is a column called Ip_Address.
    There i want to prevent duplicate entry .
    How can i do this ?

    hey i have a requirement that to restrict duplicate entry in both block(both multi record).the blocks are DEPT(MATER)
    EMP(DETAIL)
    the associated fieds in master block DEPT.DEPT_NO,in detail EMP.EMP_ID .
    I have done' Kevin D Clarke’s calculated item ' both in master and detail block
    its working fine for master block but in case of detail block its only respond to the current session(i.e. if the new value is inserted or save it will restrict another record to be inserted of that last record's value),it does not restrict duplicate value enter ,checking with other existing records(which are saved in earlier session,though after query it is shown on the form)
    can anyone guide me why its not working

  • How to check duplicate entries in internal table??

    Dear Friends,
    How to check duplicate entries in internal table??
    Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
    Thanks,
    Sridhar

    Hi,
    After storing the data into internal table say ITAb, move the data into another internal table.
    t_dup[] = itab[].
    LOOP AT itab.
        count1 = count1 + 1.
        itab-count1 = count1.
        MODIFY itab.
    ENDLOOP.
    LOOP AT t_dup.
        count2 = count2 + 1.
        t_dup-count2 = count2.
        MODIFY t_dup.
    ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM itab.
      LOOP AT t_dup.
        record_dup = 'N'.
        READ TABLE itab WITH KEY count1 = t_dup-count2.
        IF sy-subrc = 0.
          record_dup = 'Y'.
        ENDIF.
        IF record_dup NE 'Y'.
          t_dup-message = 'DUPLICATE ENTRY'.
          t_dup-flag = 1.
          MODIFY t_dup.
        ENDIF.
      ENDLOOP.
    Use this sample code.
    Reward pts if it is helpfull.
    Regards
    Srimanta

  • Short dumop in J2I5 (provide duplicate entry in Standard table)

    Hello Expert ,
                              We have a problem in  T.Code J2I5  ( Excise Register Extraction) input entry is lelect Excise group 20 . and a date   from 04.08.09 onwards. and select the register RG23D . it shows the run time error  ( Eg The ABAP/4 Open SQL array insert results in duplicate database record ) .  but in the standard Tcode is there possible to provide duplicate entry in Standard table
    Thaks & regards
    Aditya Kr Tripathi

    Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC
    Except.                CX_SY_OPEN_SQL_DB
    Date and Time          29.01.2010 10:57:09
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    problem occurs in this code :
       assign I_RG23D_TAB-I_RG23D_TYP to <x_rg23dtyp> casting.
       <x_extrctdata> = <x_rg23dtyp>.
        class CL_ABAP_CONTAINER_UTILITIES definition load.
        call method CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C
          EXPORTING
            IM_VALUE               = i_rg23d_tab-i_rg23d_typ
          IMPORTING
            EX_CONTAINER           = i_report_tab-extrctdata
          EXCEPTIONS
            ILLEGAL_PARAMETER_TYPE = 1
            others                 = 2.
       I_REPORT_TAB-EXTRCTDATA = I_RG23D_TAB-I_RG23D_TYP.
        COMPUTE I_REPORT_TAB-EXTRCTLNGT = STRLEN( I_REPORT_TAB-EXTRCTDATA ).
        APPEND I_REPORT_TAB.
      ENDLOOP.
      IF M_EXTRACTED = 'X'.
        LOOP AT I_RG23D_KEY.
          DELETE
          FROM  J_2IEXTRCT
          WHERE BUDAT    = I_RG23D_KEY-BUDAT
          AND   SERIALNO = I_RG23D_KEY-SERIALNO
          AND   REGISTER = I_RG23D_KEY-REGISTER
          AND   EXGRP    = I_RG23D_KEY-EXGRP.
        ENDLOOP.
      ENDIF.
    Control table check here for data Extraction
      INSERT J_2IEXTRCT FROM TABLE I_REPORT_TAB.
    If the insertion of the extract table is successfull then the table
    for Extraction is Inserted
      IF SY-SUBRC EQ 0.
        PERFORM FILL_EXTDT USING C_RG23D M_EXTRACTED.
      ENDIF.
    ENDFORM.                                                    " RG23D
    *&      Form  RG23CPART1
    Purpose : RG23C Part I extraction logic
    FORM RG23CPART1.
      DATA: $PART1      TYPE PART1_TYP,
            $LINCNT     LIKE SY-LINCT,
            M_EXTRACTED VALUE '',
            $RC         LIKE SY-SUBRC.
    *********************************************************************************************8

  • Finding Duplicate Entries in a table

    I have a table with the following fields in Oracle 10g.
    TABLE_1
    account_no | tracking_id | trans_amount
    Each account_no can have multiple tracking Id's.
    How do i query out the duplicate entries of account_no where tracking lies between 1 and 1000 ?
    Many thanks in advance for your help,
    novice.

    Hi,
    Whenever you have a question, it helps to post a little sample data, and the results you want from that data.
    You may think you're explaining clearly, but it won't be nearly as clear to someone who isn't familiar with your tables, your data, and your requirements. Sanjay and I apparantly have different ideas about what you requested, and perhaps neither is what you really want. It would be much harder for us to make mistakes and give you bad advice if you posted the data and results.
    Here's my guess:
    WITH     got_cnt     AS
         SELECT     table_1.*
         ,     COUNT (*) OVER (PARTITION BY account_no)
         FROM     table_1
         WHERE     tracking_id     BETWEEN     1
                        AND     1000
    SELECT     account_no, tracking_id, trans_amount
    FROM     got_cnt
    WHERE     cnt     > 1
    ;If there are two rows with the same account_no, and both rows have tracking_id in the given range, then both rows will be displayed.

  • Middleware Settings - Duplicate entries in the Table TCURC

    Hi Experts,
    I am doing middleware settings for integrating SAP CRM 5.0 with SAP R/3 4.7.
    Before replicating the customizing objects, i found duplicate entries for ISO Codes in the table TCURC (Field name-ISOCD).
    Following are those entries
    MANDT     WAERS     ISOCD     ALTWR     GDATU     XPRIMARY     LTEXT     KTEXT
    949     CFP       XPF       953       00.00.0000          French Franc (Pacific Islands)     Fr. Frank (Pac)
    949     CNY       CNY       156       00.00.0000     X     Chinese Renminbi     Renminbi
    949     DEM       DEM       280       00.00.0000     X     German Mark     German Mark
    949     DEM3      DEM       280       00.00.0000          (Internal) German Mark (3 dec.places)     (Int.) DEM 3 DP
    949     RMB       CNY       156       00.00.0000          Chinese Yuan Renminbi     Yuan Renminbi
    949     USD       USD       840       00.00.0000     X     United States Dollar     US Dollar
    949     USDN      USD       840       00.00.0000          (Internal) United States Dollar (5 Dec.)     US Dollar
    949     XPF       XPF       953       00.00.0000     X     CFP Franc     Franc
    Duplicate entries are in the third column.
    Please kindly let me know what is the impact and what should i do now.
    Points will be rewarded for the helpful answers.
    Thanks in advance
    Nadh.R

    Hi Murali,
    Thanks for your reply.
    But i didnt find anything related to the issue in that note.
    Do you have any other solution.
    Thanks
    Nadh.

  • DUplicate entries in DB table

    Hi everyone
    I am a little confused by a situtation I have come across in one of our bespoke tables.  I was under the impression that all fields in a table that are marked as Key form a Primary Key and therefore it is <b>impossible</b> to create records where these key fields contain duplciate data.  However, I have found a bespoke table that is used for logging exception messages that appears to hold records with duplicates in the Key fields.  Has anyone else come across this or have any idea how it might be happening?  When creating a table is possible to specify a non-unique key in the same way you might for an internal table?! If it is relevant, the table is updated from a program that locks and unlocks the table before and afer the insert takes place and can be caused by both batch and manual changes.
    Thanks
    Andy

    Thanks Roopesh
    I understood the [ACCEPTING DUPLICATE KEYS] flag to mean that a a 'bulk' insert would not fail if a duplicate entry was identified but instead would set subrc to 4, skip the record in question and continue with subsequent records.  If this is the case it still should not actually create duplciate entries - surely in doing so referential integrity is being violated...
    Here is the section of code that performs the insert if that helps at all:
    *lock table and insert processing log details
    CALL FUNCTION 'ENQUEUE_EZLG_T024E'
    EXPORTING
       MODE_ZLG_T024           = 'E'
       MANDT                   = SY-MANDT
       EMPLOYER_REG_NO         = zlg_t024-EMPLOYER_REG_NO
       GRANT_CLAIM_NO          = zlg_t024-GRANT_CLAIM_NO
       ITEM                    = zlg_t024-ITEM
    EXCEPTIONS
       FOREIGN_LOCK            = 1
       SYSTEM_FAILURE          = 2
       OTHERS                  = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    insert zlg_t024.
    * unlock table.
    CALL FUNCTION 'DEQUEUE_EZLG_T024E'
    EXPORTING
       MODE_ZLG_T024           = 'E'
       MANDT                   = SY-MANDT
       EMPLOYER_REG_NO         = zlg_t024-EMPLOYER_REG_NO
       GRANT_CLAIM_NO          = zlg_t024-GRANT_CLAIM_NO
       ITEM                    = zlg_t024-ITEM
    Kind regards
    Andy

  • Duplicate Entry in Child Tables in AD Process Form on triggering multipleAP

    hi all,
    I have a scenarion in which I have to provision AD Group Membership, for addition of each role to User.
    so I have created 5 Access policies, 5 roles and mapped AD Group in each access policy.
    The roles are comming from trusted source seperated by a string tokenizer.
    I have java code which will trigger and assign the role memberhsip to user, one after the other. iterating with the string tokenizer(;)
    The problem I see is, I see multiple entries of AD Groups in the process form for each group.
    If I add 3 roles to the user, I am seeing 6 entries in the AD Process form. Duplicate row for each and every row. sometimes i see 3 entries for each row. and 1 entry for each row.
    If I add the role memberships manually, by searching, then I dont see any problem with the AD child form.
    and also If I add a single group membership I dont see any problem with the AD Child form.
    I suspect that the event handler tcEvaluateAccessPolicies which is there in the post update is trying to add the duplicate entries as still the AD Group membership which is triggered for the first time is not yet finished by evaluating the access policies again.
    any such experiences? thoughts? work arounds?
    my oim environment is OIM11.1.1.3.0 on weblogic server.

    I have always coded these checks into my custom code whenever i maninuplate child table data. When adding, i always check the existing and when deleting, i always check if the value exists that i'm removing. I would suggest you write a piece of code that does the same and keep it in your library of re-usable code.
    You could try going to the database and making the field for the name a unique field. I don't know what the outcome will be from doing so.
    -Kevin

  • Duplicate entries in mms_rbs_subscription table

    We use a mobile iOS Application which is connected a SUP 2.1 Server. The Application runs fine until a couple of weeks but now we got some synchronisation problems. Some users don't get data changes on their devices.
    Probably we have identified one possible reason for these synchronisation problem.
    In the CDB we have duplicate entries in the mm_rbs_subscription table. Duplicate means, that for one device_id there are two or three remote_ids in this table. We dont know the reason, but we assume that these entries were created during our iOS7 Migration.
    Maybe this entries are one of the reasons for our current synchronisation problems.
    Did anybody know, how which entries would be created? And is it possible to delete entries in the mms_subscription table?

    Hi Shiv,
    thanks for your answer. In our Application every MBO is collected in a cachegroup. We have 5 cachegroups, including the default cache group, every cache group contains round about 1 to 5 MBOs.
    What do you mean with "Partition" option. The cache group policy is configured to scheduled, so i can't set a partition option here.. Is there any other possibility to set a "partition" option?
    Best regards,
    Ingo

  • Prevent duplicate outputs within a table?

    Hi at all,
    we have a table in a subform. At the moment there are several lines with the same material. This is ok.
    Is it possible to prevent duplicate output in the form? We want to print out the rest of this line but set the material to blank.
    I tried this with scripting with java script:
    If (data.TF.DATA.field.rawValue == data.TF.DATA[-1].field.rawValue)
         data.TF.DATA.field.rawValue = "";
    Is it possible to point on the previous line with
    DATA[-1]
    This works for the conditional break so I hope this will works too.
    I don`t want to use group levels...
    Thanks.
    Timo

    Thanks for your answer.
    It works.
    data.formular.DATA.field::ready:layout - (FormCalc, client)
    If ($.rawValue == data.form.DATA[-1].field.rawValue) then
         this.presence = "hidden";
    endif

  • How can I restore corrupt form history and prevent duplicate entries?

    After having used 3.6.2, I recently upgraded to the latest version because I was getting tired of sites not working properly. For the most part, the transition has gone smoothly, but I lost all of my form history. It's not a huge deal, but having it was incredibly convenient for me. Instead of continuing to make all new form history entries, is it possible to use the old ones again? I have the original formhistory.sqlite file, but whenever I try to use it, it gets renamed to formhistory.sqlite.corrupt and Firefox creates a new file. Is the original too old and incompatible or is there something I can do?
    Also, I'm having a bit of an issue with Firefox regularly creating duplicate form history entries. For instance, when opening the list for a Username text field, "ZombieToast" will be listed twice. I delete the duplicates when I come across them, but they keep sprouting up and I don't know why.

    hello, the duplicate form entries are a bug in firefox 23 and will be fixed in the upcoming version.
    please also [https://www.mozilla.org/en-US/plugincheck/ update your plugins] (some of them are out-dated & have security vulnerabilities that are actively exploited on the web).

  • Prevent Duplicate Entries through Validation after submit apex 4.1

    Hi There
    I'm having issues with the following, i'm creating a validation after submit, if the column FFILE already has the same data then do no insert the submission. I've also thought doing a constraint for the column with a check key, but not sure how to write constraint expression in pl/sql as text.
    so for the validation creation i have
    SQL
    type: Exists
    Validation Expression
    select 1 from PLDB2 where FFILE = :P2_FFILE
    FFILE is the column, P2_File is the number field on a form page for users to submit along with other data.
    If i want to check more than one column with the entries, how would i write the expression?
    Thank you kindly,
    Below is my table
    CREATE TABLE "PLDB2"
    (     "ID" NUMBER,
         "BANK" VARCHAR2(30),
         "END_DATE" DATE,
         "FFILE" NUMBER,
         "CLERK" VARCHAR2(30),
         "MORTGAGE_FILE_NUMBER" VARCHAR2(500),
         "MORTGAGOR" VARCHAR2(30),
         "PROPERTY_ADDRESS" VARCHAR2(500),
         "OCCUPANCY" VARCHAR2(30),
         "INSURER" VARCHAR2(10),
         "COMMISSION" VARCHAR2(5),
         "START_DATE" DATE,
         "PM_COST" VARCHAR2(500),
         "LISTING_CLERK" VARCHAR2(50),
         "NUMBER_OF_DAYS" NUMBER,
         "CLOSING" DATE,
         "FCOMMENT" VARCHAR2(500),
         "ESCALATED_FILES" VARCHAR2(30),
         "CURRENT_FILES" VARCHAR2(30),
         "MORTGAGOR_OCCUPANCYAWAITING_E" VARCHAR2(30),
         "LISTED_FILES" VARCHAR2(30),
         "CHECK_LIST_RECIEVED" DATE,
         "CREATED_ON_PKW" DATE,
         "SPECIAL_CODED_FILE" NVARCHAR2(500),
         "FILES_WITH_ISSUES" NVARCHAR2(500),
         "APPRAISED_VALUE" NUMBER,
         "SALE_PRICE" NUMBER,
         "MORTGAGE_BALANCE" NUMBER,
         "PM_CONTACT" VARCHAR2(500),
         "NPMCOST" NUMBER,
         "SOLD" NVARCHAR2(500),
         "TRANSFER" NVARCHAR2(500),
         CONSTRAINT "PLDB2_PK" PRIMARY KEY ("ID") ENABLE
    CREATE OR REPLACE TRIGGER "PLDB2_T1"
    BEFORE
    insert or update on "PLDB2"
    for each row
    declare
    v_number_of_days number;
    begin
    IF :NEW.END_DATE IS NULL THEN
    v_number_of_days :=NULL;
    ELSE
    v_number_of_days := to_date(:NEW.START_DATE,'DD/MM/YYYY') - to_date(:NEW.END_DATE,'DD/MM/YYYY');
    END IF;
    :NEW.NUMBER_OF_DAYS := v_number_of_days;
    end;
    ALTER TRIGGER "PLDB2_T1" ENABLE;
    CREATE OR REPLACE TRIGGER "bi_PLDB2"
    before insert on "PLDB2"
    for each row
    begin
    if :new."ID" is null then
    select "PLDB2_SEQ".nextval into :new."ID" from dual;
    end if;
    end;
    ALTER TRIGGER "bi_PLDB2" ENABLE;

    Hi,
    I'm having issues with the following, i'm creating a validation after submit, if the column FFILE already has the same data then do no insert the submission. I've also thought doing a constraint for the column with a check key, but not sure how to write constraint expression in pl/sql as text.so for the validation creation i have
    SQL
    type: Exists
    Validation Expression
    select 1 from PLDB2 where FFILE = :P2_FFILE
    FFILE is the column, P2_File is the number field on a form page for users to submit along with other data.
    If i want to check more than one column with the entries, how would i write the expression?>
    select 1 from PLDB2 where FFILE IN (:P2_FFILE,:P2_FFILE_1,...,:P2_FFILE_n)Is that what you are looking for?
    Cheers,

  • Duplicate Entries in Internal table

    Hi All,
    As per my requirement
    1. The internal table is the input.
    2. I need the duplicate records of the internal table with the combination of 2 key fields.
    3. I should not use SORT because i need the index number in order as per in the table .
    EX : Take Table MSEG.
    Take key fields as MBLNR and WERKS.
    I want the duplicate records of the combination of these 2 key fields.
    The *Index Number * should not to be changed as per the table entry. ( So i avoided sorting the internal table)
    Kindly give some solutions.
    Thanks,
    Pradeep.
    Moderator message : Duplicate post locked,follow forum Rules of Engagement. Thread locked.
    Edited by: Vinod Kumar on Mar 1, 2012 4:59 PM

    Hi Pradeep,
    Try this...
    first you copy your internal table to another temporary table of same type.
    itab_temp[] = itab[].
    sort itab_temp[].
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MBLNR WERKS.
    LOOP AT ITAB_TEMP INTO WA_ITAB1.
    DO.
        READ TABLE ITAB INTO WA_ITAB2 WITH KEY MBLNR = WA_ITAB1-MBLNR AND  WERKS = WA_ITAB1-WERKS.
        IF SY-SUBRC EQ 0.
             APPEND WA_ITAB2 TO ITAB_NEW.
        ELSE.
             EXIT.
        ENDIF.
    ENDDO.
    ENDLOOP.
    you may get the duplicate records in itab_new.

  • Duplicate Entries in Internal Tables

    Hallo Friends,
    It Would be nice if some one let me know, if there is a way in ABAP to select the duplicates records in an internal tables.
    Lets say I have two internal tabels, itabA have following structure:
    BNAME  |          WORKAREA   |   ROLES
    abc |             wa1 |          ro1
    cde  |            wa1 |          ro1
    cde  |      wa3 |          rol..
    abc  |      wa2 |          rol2
    xyz |       wa1 |          rol3
    xyz  |      wa3  |         rol2..
    the itabB have the following structure:
    WORKAREA |      ROLES|  
    wa1   |         rol1
    wa2  |        rol1
    wa3  |          rol1
    wa4  |          rol1
    Now problem is, I need to select the common WorkAreas from itabA ( which is commom in all BNAME ) in above example it will be workarea wa1. as it is commom in all i.e ( abc ,cde and xyz). I need to select this commom workarea, and then mark it with some flage in itabB ( to display that this workarea is common among the users...)
    Would be nice if some one let me know, is there any way I can select the duplicate rows in an internal table or I have to go one by one and then do some kind of comparision.
    Many thanks,
    Thx in advance....
    Haider

    Hi marek,
    below information might help you.
    The first criterion for comparing internal tables is the number of lines they contain. The more lines an internal table contains, the larger it is. If two internal tables contain the same number of lines, they are compared line by line, component by component. If components of the table lines are themselves internal tables, they are compared recursively. If you are testing internal tables for anything other than equality, the comparison stops when it reaches the first pair of components that are unequal, and returns the corresponding result.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB LIKE TABLE OF LINE,
    JTAB LIKE TABLE OF LINE.
    DO 3 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    MOVE ITAB TO JTAB.
    LINE-COL1 = 10. LINE-COL2 = 20.
    APPEND LINE TO ITAB.
    IF ITAB GT JTAB.
    WRITE / 'ITAB GT JTAB'.
    ENDIF.
    APPEND LINE TO JTAB.
    IF ITAB EQ JTAB.
    WRITE / 'ITAB EQ JTAB'.
    ENDIF.
    LINE-COL1 = 30. LINE-COL2 = 80.
    APPEND LINE TO ITAB.
    IF JTAB LE ITAB.
    WRITE / 'JTAB LE ITAB'.
    ENDIF.
    LINE-COL1 = 50. LINE-COL2 = 60.
    APPEND LINE TO JTAB.
    IF ITAB NE JTAB.
    WRITE / 'ITAB NE JTAB'.
    ENDIF.
    IF ITAB LT JTAB.
    WRITE / 'ITAB LT JTAB'.
    ENDIF.
    The output is:
    ITAB GT JTAB
    ITAB EQ JTAB
    JTAB LE ITAB
    ITAB NE JTAB
    ITAB LT JTAB
    This example creates two standard tables, ITAB and JTAB. ITAB is filled with 3 lines and copied to JTAB. Then, another line is appended to ITAB and the first logical expression tests whether ITAB is greater than JTAB. After appending the same line to JTAB, the second logical expression tests whether both tables are equal. Then, another line is appended to ITAB and the third logical expressions tests whether JTAB is less than or equal to ITAB. Next, another line is appended to JTAB. Its contents are unequal to the contents of the last line of ITAB. The next logical expressions test whether ITAB is not equal to JTAB. The first table field whose contents are different in ITAB and JTAB is COL1 in the last line of the table: 30 in ITAB and 50 in JTAB. Therefore, in the last logical expression, ITAB is less than JTAB.
    reward with points and close the thread if your question is solved
    regards,
    venu.

Maybe you are looking for