Duplicate Records in Out-Of-Line Tables

Hi,
I am using the following XML Schema:
<?xml version="1.0"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns:t="http://www.informatik.hu-berlin.de/~vitt/stud/studienarbeit/test-duplicates"
xmlns:xdb="http://xmlns.oracle.com/xdb"
targetNamespace="http://www.informatik.hu-berlin.de/~vitt/stud/studienarbeit/test-duplicates"
>
<xs:complexType name="eltype" xdb:SQLType="ELTYPE">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="nid" xdb:SQLName="NID" type="xs:ID"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="outerElement" xdb:defaultTable="OUTER_ELEMENT">
<xs:complexType>
<xs:sequence>
<xs:element name="innerElement" type="t:eltype" maxOccurs="unbounded"
xdb:SQLInline="false" xdb:defaultTable="INNER_ELEMENT"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
When inserting the XML document:
<?xml version="1.0"?>
<t:outerElement
xmlns:t="http://www.informatik.hu-berlin.de/~vitt/stud/studienarbeit/test-duplicates"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.informatik.hu-berlin.de/~vitt/stud/studienarbeit/test-duplicates
http://www.informatik.hu-berlin.de/~vitt/stud/studienarbeit/schemas/test-duplicates.xsd">
<t:innerElement nid="one">Eins</t:innerElement>
<t:innerElement nid="two">Zwei</t:innerElement>
</t:outerElement>
once into the previously empty OUTER_TABLE table, the innerElements appear twice:
SQL> select * from inner_element;
SYS_NC_ROWINFO$
<t:innerElement nid="one">Eins</t:innerElement>
<t:innerElement nid="two">Zwei</t:innerElement>
<t:innerElement nid="one">Eins</t:innerElement>
<t:innerElement nid="two">Zwei</t:innerElement>
SQL>
Is there a way to avoid this? Or is this an issue which has been fixed in an Oracle newer than my 9.2.0.1?
Kind Regards,
Thorsten

Mark,
thanks for your reply.
You must upgradeThis is in progress, I hope ...
BTW Did you export and import the content of the
table I cannot get importing to work. Appearently, the INNER_ELEMENT's root element name,
innerElement, does not make it to the import utility:
IMP-00017: following statement failed with ORACLE error 1741:
"CREATE TABLE "VITT"."INNER_ELEMENT" OF "SYS"."XMLTYPE" XMLSCHEMA "http://w"
"ww.informatik.hu-berlin.de/~vitt/stud/studienarbeit/schemas/test-duplicates"
".xsd" ELEMENT "" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS L"
"OGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 214748364"
"5 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPA"
"CE "VITT" "
IMP-00003: ORACLE error 1741 encountered
ORA-01741: illegal zero-length identifier
grep finds it in the dump file, though.
and does the table use nested table storage.No. But the problem persists if I do so.
Kind regards,
Thorsten

Similar Messages

  • Can't delete from parent table if FK constraint on the out-of-line table

    Using Oracle XML DB 11g
    I am using out-of-line storage table to store a collection of XML elements in conjuction with storeVarrayAsTable="true". So what I have is a parent table containing a nested table of VARRAY of REFs to rows in the out-of-line table.
    In addition, I have a foreign key constraint placed on a column in the out-of-line table.
    My problem is that I am not able to delete rows from the parent table when the FK constraint is placed on the out-of-line table. Only when I drop the FK constraint does the deletion work - all associated rows in the nested table and out-of-line table
    gets deleted correctly.
    With the FK constraint, deleting the child document like this
    dbms_xdb.deleteResource('/project-1.xml')
    gives me this error:
    ORA-31018: Error deleting XML document
    ORA-03001: unimplemented feature
    *Cause:  The XMLType object pointed to by the given REF could not
    be deleted because either the REF was invalid or it pointed to a non-existent table.
         *Action:  Either use FORCE deletion or supply a valid REF.
    I have tried deleting with the FORCE options as well with no success.
    Using DBMS_XDB.DELETE_RECURSIVE_FORCE option doesn't produce an error, but doesn't perform the deletion either.
    Here is the XML Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xlink="http://www.w3.org/1999/xlink"
    elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
    <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.w3.org/1999/xlink.xsd"/>
    <xs:element name="project" xdb:defaultTable="PROJECT_TAB">
    <xs:complexType xdb:SQLType="PROJECT_TYP">
    <xs:sequence>
    <xs:element name="resourceList" minOccurs="0" xdb:SQLName="RESOURCE_LIST">
    <xs:complexType xdb:SQLType="RESOURCE_LIST_TYP">
    <xs:sequence>
    <xs:element name="aResource" type="refType" minOccurs="0" maxOccurs="unbounded" xdb:SQLInline="false"
    xdb:SQLName="A_RESOURCE_REF" xdb:defaultTable="RESOURCE_REF_TAB"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="aguid" type="xs:string" use="required" xdb:SQLName="AGUID"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="aResource" xdb:defaultTable="A_RESOURCE_TAB">
    <xs:complexType xdb:SQLType="A_RESOURCE_TYP">
    <xs:complexContent>
    <xs:extension base="contactType">
    <xs:attribute name="aguid" type="xs:string" use="required" xdb:SQLName="AGUID"/>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="contactType" xdb:SQLType="CONTACT_TYP">
    <xs:sequence>
    <xs:element name="name" type="xs:string" xdb:SQLName="NAME"/>
    <xs:element name="email" type="xs:string" minOccurs="0" xdb:SQLName="EMAIL"/>
    <xs:element name="phone" type="xs:string" xdb:SQLName="PHONE"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="refType" xdb:SQLType="REF_TYP">
    <xs:attribute ref="xlink:href" use="required"/>
    <xs:attribute name="oref" type="xs:string" use="optional" xdb:SQLName="OREF"/>
    </xs:complexType>
    </xs:schema>
    I registered the schema using structured storage with these options:
    BEGIN
    DBMS_XMLSCHEMA.registerschema(
    SCHEMAURL => 'LSDProjects.xsd',
    SCHEMADOC => xdbURIType('/home/LSDProject2/LSDProjects.xsd').getClob(),
    LOCAL => TRUE, -- local
    GENTYPES => TRUE, -- generate object types
    GENBEAN => FALSE, -- no java beans
    GENTABLES => TRUE -- generate object tables
    END;
    The PK and FK constraints were added like this:
    -- Add PK constraints on aResource/@aguid attributes
    ALTER TABLE A_RESOURCE_TAB ADD CONSTRAINT A_RESOURCE_AGUID_IS_UNIQUE UNIQUE (XMLDATA."AGUID");
    -- Add FK constraint on out-of-line table
    ALTER TABLE RESOURCE_REF_TAB
    ADD (CONSTRAINT ref_resource_aguid_is_valid FOREIGN KEY (XMLDATA."OREF")
    REFERENCES A_RESOURCE_TAB(XMLDATA."AGUID"));
    Here are the XML instance documents:
         where resource-1.xml looks like this :
    <aResource aguid="resource-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LSDProjects.xsd">
         <name>Jane Doe</name>
         <email>[email protected]</email>
    <phone/>
    </aResource>
         and project-1.xml looks like this :
         <project aguid="project-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LSDProjects.xsd"
                   xmlns:xlink="http://www.w3.org/1999/xlink">               
              <resourceList>
                   <aResource xlink:href="/resource-1.xml" oref="resource-1"/>                         
              </resourceList>     
         </project>
    where <project> document contains a collection of <aResource> elements stored in the out-of-line table and
    project/@oref attribute is a foreign key to the primary aResource/@aguid attribute.
    Can someone shed some light on why I am unable to delete "project-1.xml" from the repository when the FK constraint is applied onto the out-of-line table.
    Any advice/suggestions would be appreciated. Thanks!

    Thank you for the quick reply, mdrake.
    I am currently prototyping and testing out (best) ways to achieve data integrity with XML data in XML DB.
    I have instance documents that makes cross references to values in other instance documents
    (not of the same root nodes). What I'm trying to enforce is a referential constraint between the documents
    so that a document cannot be inserted if the referenced document doesn't exists.
    In this situation, a <project> document contains a collection of elements with @oref attributes.
    The collection is stored in an out-of-line table.
    For example:
    <project>
    <resourceList>
    <aResource ... oref="resource-1"/>
    <aResource ... oref="resource-2"/>
    </resourceList>
    </project>
    The @oref (FK) attribute above references a @aguid (PK) attribute in <aResource> document (below):
    <aResource aguid="resource-1"> .... </aResource>
    Basically, I want to ensure that the value of
    /project/resourceList/aResource/@oref
    correspond to a valid
    /aResource/@aguid
    Note that I was able to add the FK constraint on the OOL table without any issues.
    And the constraint did work as expected as I was not allowed to insert a <project> document
    that referenced a non-existent /aResource/@aguid.
    The problem was that I could not delete the <project> document from the XML DB repository
    once the FK contraint was added. Deleting with the DELETE_RECURSIVE_FORCE option did not give
    me any errors - is just didn't do anything.
    I guess there are certain limitations with using out-of-line tables.
    BTW, sorry the examples are hard to read as the indentations are removed when posting.

  • Help With Ora-19046:Out-of-line table cannot be shared by two top-level tab

    Hi!
    My tutor asked me to store and query the xml files in a "native" way in xml db. First I tried to register the schemas on which those xml files are based. There are about 30 of schemas asscociated with each other, and I have to use "FORCE" to register them , like this:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'http://www.isotc211.org/gmd/metadataEntity.xsd',
    bfilename('ISOGMD', 'metadataEntity.xsd'),
    TRUE,
    TRUE,
    FALSE,
    TRUE,
    TRUE);
    END;
    Then no tables are created automaticly. And when I wanted to create a XML table based on thses schemas manually, it proped the error: ORA-19046:Out-of-line table cannot be shared by two top-level tab. This has confused me for about a week. Does anyone know what's wrong with the registration? Waiting eagerly on line! Thanks!

    First of all, i create a "filename.txt" that contains all my schemas' names. the names are:
    acquisitionInformation.xsd
    applicationSchema.xsd
    basicTypes.xsd
    catalogues.xsd
    citation.xsd
    codelistItem.xsd
    constraints.xsd
    temporalTopology.xsd
    topology.xsd
    units.xsd
    uomItem.xsd
    valueObjects.xsd
    xlinks.xsd
    there are 72 schemas. Then I register them using "force":
    GRANT EXECUTE ON utl_file to fld;
    create table test (
    fld1 VARCHAR2(50));
    declare
    isto_file utl_file.file_type;
    fp_buffer varchar2(4000);
    begin
    isto_file := utl_file.fopen('MYXMLDIR', 'filename.txt', 'R');
    loop
    begin
    utl_file.get_line (isto_file , fp_buffer );
    insert into test values(fp_buffer);
    Exception
    when no_data_found then
    exit;
    end;
    end loop;
    utl_file.fclose(isto_file);
    end;
    declare
    cursor my_cursor is select fld1 from test;
    v_name varchar2(50);
    begin
    open my_cursor;
    loop
    fetch my_cursor into v_name;
    dbms_xmlschema.registerSchema(
    schemaurl=>v_name,
    schemadoc=>bfilename('MYXMLDIR',v_name),
    local=>TRUE,
    gentables=>true,
    force=>true,
    csid=>nls_charset_id('AL32UTF8')
    exit when my_cursor%NOTFOUND;
    end loop;
    close my_cursor;
    end;
    at last, when I check the types generated during registration, I found that only a small number of types are automatically generated. When I try to create table manually ( based on certain element of one schema), it props errors, sometimes "31079. 00000 - "unable to resolve reference to %s \"%s\"" ", sometimes other errors.
    If I manually register them one by one from the base schema, then the registeration fail at some point. this is the script:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'geometryAggregates.xsd',
    bfilename('XSD', 'geometryAggregates.xsd'),
    TRUE,
    TRUE,
    FALSE,
    TRUE);
    END;
    ERRORS
    22881. 00000 - "dangling REF"
    Is that something wrong with my schemas? I wonder how can i paste them here. there are 72 files.......

  • Avoiding duplicate records while inserting into the table

    Hi
    I tried the following insert statement , where i want to avoid the duplicate records while inserting itself
    but giving me the errror like invalid identifier, though the column exists in the table
    Please let me know Where i'm doing the mistake.
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm1 where tm1.O_ID=tm.o_id
                                                                        and tm1.sn_id=tm.sn_id
                                                                        and tm1.txt=tm.txt
                                                                        and tm1.typ=tm.typ
                                                                        and tm1.sn_time=tm.sn_time )

    Then
    you have to join the table with alias tml where is that ?do you want like this?
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm where sk.obj_ID=tm.o_id
                                                                        and 100=tm.sn_id
                                                                        and sk.key_txt=tm.txt
                                                                        and sk.obj_typ=tm.typ
                                                                        and sysdate=tm.sn_time )

  • Duplicate records in PO scheduled line for framework order (going for dump)

    Hi all,
    i am creating framework purchase order with item category B. I am assigning external number range for PO. This PO is created with respect to expense PR. i just found there is duplicate records are appearing in schedule line for the same item.
    Then, after i save the PO, it is going for dump & sending some message to SAP inbox that there is duplicate records.
    later i can not find those PO in the system. Please let me know where i am doing mistake ? why duplicate records are appearing in PO scheduled line ?
    Thanks a lot
      pabi

    Hi,
    Once you please debug the particular program with the help of ABAPer. That may resolve your issue. Thanking you

  • Remove all duplicate records and load into temp table

    Hi
    I have a table contains data like this.
    Emp No Designation location
    1111 SE CA
    1111 DE CT
    3456 WE NJ
    4523 TY GH
    We found that there are two duplicate records for emp no: 1111. I want to delete all duplicate records (in this case two records for emp no:1111) and load into the temp table.
    Please advice me how to do it.

    Oh look, you can search the forums...
    http://forums.oracle.com/forums/search.jspa?threadID=&q=delete+duplicates&objID=f75&dateRange=all&userID=&numResults=30

  • How to tune the query for duplicate records while joining the two tables

    hi,i am executing the query which has retrieving multiple tables,in which one of them has duplicate record,how to get single record

    Not enough info...subject says "tune" the query, message says "write" the query...and where is actual query that you had tried ?

  • Duplicate records in Fact Tables

    Hi,
    We are using BPC 7.0 MS SP7. BPC created duplicate records in WB and Fac2 tables. We faced similar issue before and the solution was to reboot the server and cleanup the additional data created. I think it should not be an issue with the script logic files we have. We had the issue across all applications. Data is fine now after the server reboot and running the same logic files.  I want to know if any one faced this issue and if there is any solution other than reboot. I appreciate your help.
    Thanks
    Raj

    Hi Sorin,
    I know this thread is rather old, but i have a problem which is pretty much related to this thread and appreciate if you could assist me. I have client running on 7.0 MS who has been using it for the past 3 years.
    It is a heavily customized system with many batch files running daily to update dimensions, copy data and sort. And Yes we do use custom packages that incorporates stored procedures.
    Recently, with no change in environment, we encountered our factwb ballooning up out of no where. fact table only contains less then 1 gb data but, factwb has 200 gb data and practically paralayzed the system. There is also equilavent 300 gb increase in the log files.
    We are not able to find out what caused this? Or if even the 200gb records in wb are even valid records that are duplicated. Is there a way to troubleshoot this?

  • Duplicate records in database view for ANLA and ANLC tables

    HI all,
    Can any one please suggest me how to remove duplicate records from ANLA and ANLC tables when creating a database view.
    thanks in advance,
    ben.

    Hi,
    Suppose we have two tables one with one field and another with two fields:
    TAB1 - Key field KEY1
    TAB2 - Key fields KEY1 & Key 2.
    No if we create a Database view of these two tables we can do by joining these two tables on Key field KEY1.
    Now if in View tab we have inculded TAB1- Key1.
    Now lets suppose following four entries are in table TAB1: (AAA), (BBB), (CCC).
    and following entries are in table TAB2: (AAA, 1), (AAA, 2),  (BBB, 3), (BBB, 5), (DDD, 3).
    The data base view will show following entries:
    AAA,
    AAA,
    BBB,
    BBB,
    Now these entris are duplicate in the output.
    This is because TAB2 has multilple entries for same key value of TAB1.
    Now if we want to remove multiple entries from ouput - we need to include an entry in selection conditions like TAB2-KEY2 = '1'.
    Regards,
    Pranav.

  • Duplicates Records

    I'm still new to SBO. What is a good way to check data for duplicate records. I want any duplicate records to go into another table and only the first to pass.
    Thansk for your help

    Depends on how you want to find duplicates.
    You can find more detail here:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/DeDuplicatesourcedata

  • Technical Content Object - Duplicate Records

    Hi,
    My PSA getting duplicate records for Technical Content Object. Due to that the load becoming failure.
    Can I remove duplicate records form the Technical Content tables ?
    Thanks,
    Abhi.

    Its 3.x Data Source. So it doesn't have DTP. I found  SAP Note 1229385 - BIAC:Duplicate entries for 0TCTPRCVAR_TEXT in PSA . But it will works for SP19. We are on SP18.
    KIndly pls let me know SAP Note for SP18 to avoid Duplicate entries for 0TCTPRCVAR_TEXT in PSA.
    Thanks,
    Abhi.

  • Ingestion Performance with Out-of-line on Large Schema

    I have a large and complex schema consisting of 5 XSD's and few hundred complex types and a few thousand elements. This schema will be used for loading files ranging from 50mb to 650mb.
    Since there are circular references and self references, I have annotated out-of-line storage for a few of the global element references. The ingestion performance for a very small sample file of 800k has shown severe performance problems with the ingestion. By using a sql trace, I have been able to limit the problem to the out-of-line storage.
    This 800k file should be able to load in under one second yet it has taken almost 2 minutes. The inserts to the out-of-line tables represent about 80%+ of the total time. Both of the entries I have included below are out-of-line tables.
    From the Trace
    1 session in tracefile.
    2109 user SQL statements in trace file.
    1336 internal SQL statements in trace file.
    3445 SQL statements in trace file.
    74 unique SQL statements in trace file.
    148036 lines in trace file.
    133 elapsed seconds in trace file.
    INSERT /*+ NO_REF_CASCADE NESTED_TABLE_SET_REFS */ INTO
    "<VENDOR>"."GSMRELATION_VSDATA" e (e.sys_nc_rowinfo$,e.sys_nc_oid$,
    e.docid)
    VALUES
    (:1,:2,:3) RETURNING e.sys_nc_oid$,e.rowid INTO :4,:5
    call count cpu elapsed disk query current rows
    Parse 323 0.03 0.02 0 0 0 0
    Execute 323 42.64 41.91 0 4178 3418 323
    Fetch 0 0.00 0.00 0 0 0 0
    total 646 42.67 41.94 0 4178 3418 323
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: 60 (recursive depth: 1)
    INSERT /*+ NO_REF_CASCADE NESTED_TABLE_SET_REFS */ INTO
    "<VENDOR>"."UTRAN_VSDATA" e (e.sys_nc_rowinfo$,e.sys_nc_oid$,e.docid)
    VALUES
    (:1,:2,:3) RETURNING e.sys_nc_oid$,e.rowid INTO :4,:5
    call count cpu elapsed disk query current rows
    Parse 140 0.04 0.01 0 0 0 0
    Execute 140 18.75 18.38 0 1338 1429 140
    Fetch 0 0.00 0.00 0 0 0 0
    total 280 18.79 18.40 0 1338 1429 140
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: 60 (recursive depth: 1)
    The data above was gathered from Solaris 9 running 10.2.0.2 with the latest patches available.
    I have been able to reproduce this same error to a different degree using a personal instance of Windows XP 10.2.0.2.
    Does anyone have any idea what is happening?
    Thanks,
    VJ

    By the way, SR 5991118.993 has been created. The Oracle tech has suggested
    Bug 4369117
    Abstract: UNACCEPTABLE DIRECT PATH OUT-OF-LINE LOB INSERT PERFORMANCE
    Would this be a problem even if I'm not using CLOB annotation?
    Thanks,

  • Muliple package calls on aftercommit causing duplicate records

    I have a jsp page inserting into table A. The app module has an aftercommit method that calls a package using createCallableStatement. This package call inserts into table B.
    We found duplicate records were being created in table B. The create time is the same in the 2 duplicate records. To try to prevent the duplicates I put a check in the package before the insert to see if the record already exists then don't insert. This did not stop the duplicates. This implies that there are 2 instances of the package executing in parallel in different sessions. They can't see each others uncommitted inserts and so go ahead and insert.
    Is this possible? Could it be creating multiple sessions?

    Hi,
    to work with multiple sessions, there have to be multiple database sessions. While e.g AM pooling could have additional connections to t he database open, I don't see how a commit of one session invokes the same on another
    Frank

  • Duplicate records in master data info object

    dear friends,
    i got a standard infoobject called 'A' and it has got some attributes B,C,D,E for that one standard datasource with the following fields A,B,C,D,E  exists and i loaded data. abapers had created a z table with the following P,Q,R,S,X,Y,Z fields.  'P' holds the same records what the 'A' infoobject holds. my requirement is to create a report on the following fields:
    P,Q,R,S,B,C,D,E
    WAT I DONE IS I CREATED A GENERIC DATASOURCE FOR THE FOLLOWING FIELDS P,Q,R,S AND I ADDED THE STANDARD INFOOBJECT CALLED 'A' WITH THE FOLLOWING FIELDS: Q,R,S.
    AND I CRTEATED AND  SHEDULED THE INFOPACKAGE FOR THE STANDARD DATASOURCE(A,B,C,D,E,) TO STANDARD INFOOBJECT(A,B,C,D,E,Q,R,S). NEXT I CREATED THE ANOTHER INFOPACKAGE AND SHEDULED THE INFOPACKAGE AND SHEDULED FROM GENERIC DATASOURCE (P,Q,R,S) TO STANDARD INFOOBJECT(A,B,C,D,E,P,Q,R,S) WITH TRANSFER RULES P->A,Q->Q,R->R,S->S. AFTER LOADING THE DATA I AM GETTING DUPLICATE RECORDS.I WILL GIVE THE TABLE HOW MY MASTER DATA LOOKS LIKE
    A B C D E P Q R S
    1 2 3 4 5
    2 3 4 5 6
    3 4 5 6 7
    1         6 7 8 9
    2         7 8 9 3
    3         4 6 2 1
    THIS IS HOW MY MASTERDATA LOOKS LIKE BUT I NEED IN THE FOLLLOWING FORMAT:
    A B C D E P Q R S
    1 2 3 4 5 6 7 8 9
    2 3 4 5 6 7 8 9 3
    3 4 5 6 7 4 6 2 1
    PLEASE LET ME KNOW
    THANKS & REGARDS,
    HARI

    Hari,
       why don't you enhance the Masterdata info object?. You are suppose to see overwritten records. infoobject A is primary key in the table.
    try to enhance the masterdata Datasource. you will get required output or create masterdat generic Data source.
    All the best.
    any questions let us know.
    Nagesh.

  • How to find out duplicate record contained in a flat file

    Hi Experts,
    For my project I have written a program for flat file upload.
    Requirement 1
    In the flat file there may be some duplicate record like:
    Field1   Field2
    11        test1
    11        test2
    12        test3
    13        test4
    Field1 is primary key.
    Can you please let me know how I can find out the duplicate record.
    Requirement 2
    The flat file contains the header row as shown above
    Field1   Field2
    How our program can skip this record and start reading / inserting records from row no 2 ie
    11        test1
    onwards.
    Thanks
    S
    FORM upload1.
    DATA : wf_title TYPE string,
    lt_filetab TYPE filetable,
    l_separator TYPE char01,
    l_action TYPE i,
    l_count TYPE i,
    ls_filetab TYPE file_table,
    wf_delemt TYPE rollname,
    wa_fieldcat TYPE lvc_s_fcat,
    tb_fieldcat TYPE lvc_t_fcat,
    rows_read TYPE i,
    p_error TYPE char01,
    l_file TYPE string.
    DATA: wf_object(30) TYPE c,
    wf_tablnm TYPE rsdchkview.
    wf_object = 'myprogram'.
    DATA i TYPE i.
    DATA:
    lr_mdmt TYPE REF TO cl_rsdmd_mdmt,
    lr_mdmtr TYPE REF TO cl_rsdmd_mdmtr,
    lt_idocstate TYPE rsarr_t_idocstate,
    lv_subrc TYPE sysubrc.
    TYPES : BEGIN OF test_struc,
    /bic/myprogram TYPE /bic/oimyprogram,
    txtmd TYPE rstxtmd,
    END OF test_struc.
    DATA : tb_assum TYPE TABLE OF /bic/pmyprogram.
    DATA: wa_ztext TYPE /bic/tmyprogram,
    myprogram_temp TYPE ziott_assum,
    wa_myprogram TYPE /bic/pmyprogram.
    DATA : test_upload TYPE STANDARD TABLE OF test_struc,
    wa2 TYPE test_struc.
    DATA : wa_test_upload TYPE test_struc,
    ztable_data TYPE TABLE OF /bic/pmyprogram,
    ztable_text TYPE TABLE OF /bic/tmyprogram,
    wa_upld_text TYPE /bic/tmyprogram,
    wa_upld_data TYPE /bic/pmyprogram,
    t_assum TYPE ziott_assum.
    DATA : wa1 LIKE test_upload.
    wf_title = text-026.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    window_title = wf_title
    default_extension = 'txt'
    file_filter = 'Tab delimited Text Files (*.txt)'
    CHANGING
    file_table = lt_filetab
    rc = l_count
    user_action = l_action
    EXCEPTIONS
    file_open_dialog_failed = 1
    cntl_error = 2
    OTHERS = 3. "#EC NOTEXT
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_filetab INTO ls_filetab.
    l_file = ls_filetab.
    ENDLOOP.
    CHECK l_action = 0.
    IF l_file IS INITIAL.
    EXIT.
    ENDIF.
    l_separator = 'X'.
    wa_fieldcat-fieldname = 'test'.
    wa_fieldcat-dd_roll = wf_delemt.
    APPEND wa_fieldcat TO tb_fieldcat.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    CLEAR wa_test_upload.
    Upload file from front-end (PC)
    File format is tab-delimited ASCII
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = l_file
    has_field_separator = l_separator
    TABLES
    data_tab = i_mara
    data_tab = test_upload
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    IF sy-subrc 0.
    EXIT.
    ELSE.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    IF test_upload IS NOT INITIAL.
    DESCRIBE TABLE test_upload LINES rows_read.
    CLEAR : wa_test_upload,wa_upld_data.
    LOOP AT test_upload INTO wa_test_upload.
    CLEAR : p_error.
    rows_read = sy-tabix.
    IF wa_test_upload-/bic/myprogram IS INITIAL.
    p_error = 'X'.
    MESSAGE s153 WITH wa_test_upload-/bic/myprogram sy-tabix.
    CONTINUE.
    ELSE.
    TRANSLATE wa_test_upload-/bic/myprogram TO UPPER CASE.
    wa_upld_text-txtmd = wa_test_upload-txtmd.
    wa_upld_text-txtsh = wa_test_upload-txtmd.
    wa_upld_text-langu = sy-langu.
    wa_upld_data-chrt_accts = 'xyz1'.
    wa_upld_data-co_area = '12'.
    wa_upld_data-/bic/zxyzbcsg = 'Iy'.
    wa_upld_data-objvers = 'A'.
    wa_upld_data-changed = 'I'.
    wa_upld_data-/bic/zass_mdl = 'rrr'.
    wa_upld_data-/bic/zass_typ = 'I'.
    wa_upld_data-/bic/zdriver = 'yyy'.
    wa_upld_text-langu = sy-langu.
    MOVE-CORRESPONDING wa_test_upload TO wa_upld_data.
    MOVE-CORRESPONDING wa_test_upload TO wa_upld_text.
    APPEND wa_upld_data TO ztable_data.
    APPEND wa_upld_text TO ztable_text.
    ENDIF.
    ENDLOOP.
    DELETE ADJACENT DUPLICATES FROM ztable_data.
    DELETE ADJACENT DUPLICATES FROM ztable_text.
    IF ztable_data IS NOT INITIAL.
    CALL METHOD cl_rsdmd_mdmt=>factory
    EXPORTING
    i_chabasnm = 'myprogram'
    IMPORTING
    e_r_mdmt = lr_mdmt
    EXCEPTIONS
    invalid_iobjnm = 1
    OTHERS = 2.
    CALL FUNCTION 'MESSAGES_INITIALIZE'.
    **Lock the Infoobject to update
    CALL FUNCTION 'RSDG_IOBJ_ENQUEUE'
    EXPORTING
    i_objnm = wf_object
    i_scope = '1'
    i_msgty = rs_c_error
    EXCEPTIONS
    foreign_lock = 1
    sys_failure = 2.
    IF sy-subrc = 1.
    MESSAGE i107(zddd_rr) WITH wf_object sy-msgv2.
    EXIT.
    ELSEIF sy-subrc = 2.
    MESSAGE i108(zddd_rr) WITH wf_object.
    EXIT.
    ENDIF.
    *****Update Master Table
    IF ztable_data IS NOT INITIAL.
    CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
    EXPORTING
    i_iobjnm = 'myprogram'
    i_tabclass = 'M'
    I_T_ATTR = lt_attr
    TABLES
    i_t_table = ztable_data
    EXCEPTIONS
    attribute_name_error = 1
    iobj_not_found = 2
    generate_program_error = 3
    OTHERS = 4.
    IF sy-subrc 0.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'E'
    txtnr = '054'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    MESSAGE e054(zddd_rr) WITH 'myprogram'.
    ELSE.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'S'
    txtnr = '053'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    ENDIF.
    *endif.
    *****update Text Table
    IF ztable_text IS NOT INITIAL.
    CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
    EXPORTING
    i_iobjnm = 'myprogram'
    i_tabclass = 'T'
    TABLES
    i_t_table = ztable_text
    EXCEPTIONS
    attribute_name_error = 1
    iobj_not_found = 2
    generate_program_error = 3
    OTHERS = 4.
    IF sy-subrc 0.
    CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
    arbgb = 'zddd_rr'
    msgty = 'E'
    txtnr = '055'
    msgv1 = text-033
    EXCEPTIONS
    OTHERS = 3.
    ENDIF.
    ENDIF.
    ELSE.
    MESSAGE s178(zddd_rr).
    ENDIF.
    ENDIF.
    COMMIT WORK.
    CALL FUNCTION 'RSD_CHKTAB_GET_FOR_CHA_BAS'
    EXPORTING
    i_chabasnm = 'myprogram'
    IMPORTING
    e_chktab = wf_tablnm
    EXCEPTIONS
    name_error = 1.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ****Release locks on Infoobject
    CALL FUNCTION 'RSDG_IOBJ_DEQUEUE'
    EXPORTING
    i_objnm = 'myprogram'
    i_scope = '1'.
    ENDIF.
    ENDIF.
    PERFORM data_selection .
    PERFORM update_alv_grid_display.
    CALL FUNCTION 'MESSAGES_SHOW'.
    ENDFORM.

    Can you please let me know how I can find out the duplicate record.
    you need to split the records from flat file structure into your internal table ans use a delete ADJACENT duplicates comparing fields
    split flat_str into wa_f1 wa_f2 wa_f2 at tab_space.

Maybe you are looking for

  • How to replace the harddrive in the TV

    I was wondering if i could take the HD out and image the drive so that i can put in a 1TB drive. i understand that apple will eventually update these poor things to a 2008-2009 spec, but if they don't i'd like to buy the cheaper one and replace the d

  • Possible to remove 2:3 pulldown in Premiere Pro CC?

    Hi, I've mistakenly recorded footage on a Canon C100 at PF24 rather than 24p. I'm trying to use the PF24 footage (which is in a 60i wrapper) on a 24 fps (23.976) timeline in Premiere Pro.  Is there a way to properly interpret the footage w/in Premier

  • HT201250 TIME MACHINE FOR EXTERNAL DISK BACKUP

    I intend to backup my music library (HD and iTunes in AIFF format, ca 800GB) which is located on an external USB drive to another external USB drive. Can I do this with Time machine? The mac book I am using has a different time machine connected to b

  • Apple crashes too often

    hi all, i find if i do too many things at once on my mac, the application i am trying to use freezes and i get the spinning ball. i then try to force quite but all that does is close the window not the application. as a result of this, the OS cannot

  • 3 Photos per page

    Hi, In Iphoto/Idvd/Imovie I am trying to create a slideshow. Is it possible to display 3 photos (one at a time) on the one slide? The next slide I want to display another 3 photos (again one a time) and so on? I've looked at all the slide show templa