Re: impdp - duplicate keys found error

Today I faced same problem.
impdp, expdp log are showing same number of records but target database has more number of rows(duplicate) in few tables.
Source database version 10.2.0.4 and target database version is 11.2.0.3.
I loaded the same dump file again with same par file. it loaded successfully. According to oracle support. something has interfered between data load and index creation time when the data pump in progress.
Thanks
Edited by: 931804 on Oct 11, 2012 2:35 AM

Dump import

Similar Messages

  • Impdp - duplicate keys found error

    I'm facing a strange issue. I'm running expdp / impdp using datapump. The export of the schema is successful. The import of the schema is raising the below errors for few PKs. I have verified on the source database. There are no duplicate records found and the PK is in enabled state. What is causing for this issue?. I had the similar issue earlier and run the Point-In Time export using FLASHBACK_SCN parameter and the import run smooth. But, the issue this time is the applications are shutdown and there are no connections from the application side and no DML transactions running on the schema. So, I have run the export without FLASHBACK_SCN parameter as we are moving this production database to another. But, the import is raising the below errors. Could someone let me know why it's causing?.
    ORA-39083: Object type INDEX failed to create with error:
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    ORA-39083: Object type CONSTRAINT failed to create with error:
    ORA-02437: cannot validate (schema.tab_PK) - primary key violated

    Hi,
    Can you run the impdp commnd with this:
    sqlfile=index.sql include=INDEX
    then look in index.sql to find the index that is failing and try crating it manually. The other thing is to do a query on the target table to see if there are
    duplicate keys on the target. I can't explain why, but I can't imagine why the create index would fail if there were not.
    If you have a network link between the 2 databases maybe you can do a
    select * from target minus select * from source@network_link
    to see if there is anything different.
    Dean
    Edited by: Dean Gagne on Feb 17, 2010 7:37 AM

  • ERROR ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found

    Hi,
    SAPSSRC.log
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: START OF LOG: 20071018195059
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#12 $ SAP
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: version R6.40/V1.4
    Compiled Nov 30 2005 20:41:21
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe -ctf I C:/temp/51030721/EXP2/DATA/SAPSSRC.STR C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/DDLORA.TPL C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.TSK ORA -l C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.log
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: job completed
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: END OF LOG: 20071018195059
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: START OF LOG: 20071018195133
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#12 $ SAP
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: version R6.40/V1.4
    Compiled Nov 30 2005 20:41:21
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe -dbcodepage 4103 -i C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.cmd -l C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.log -stop_on_error
    DbSl Trace: ORA-1403 when accessing table SAPUSER
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): WE8DEC
    (DB) INFO: ABTREE created #20071018195134
    (IMP) INFO: import of ABTREE completed (39 rows) #20071018195134
    (DB) INFO: ABTREE~0 created #20071018195134
    (DB) INFO: AKB_CHKCONF created #20071018195134
    (IMP) INFO: import of AKB_CHKCONF completed (0 rows) #20071018195134
    (DB) INFO: AKB_CHKCONF~0 created #20071018195134
    (DB) INFO: AKB_INDX created #20071018195134
    (IMP) INFO: import of AKB_INDX completed (0 rows) #20071018195134
    (DB) INFO: AKB_INDX~0 created #20071018195134
    (DB) INFO: AKB_USAGE_INFO created #20071018195134
    (IMP) INFO: import of AKB_USAGE_INFO completed (0 rows) #20071018195134
    (DB) INFO: AKB_USAGE_INFO~0 created #20071018195134
    (DB) INFO: AKB_USAGE_INFO2 created #20071018195134
    (IMP) INFO: import of AKB_USAGE_INFO2 completed (0 rows) #20071018195134
    (DB) INFO: AKB_USAGE_INFO2~0 created #20071018195134
    (DB) INFO: APTREE created #20071018195134
    (IMP) INFO: import of APTREE completed (388 rows) #20071018195134
    (DB) INFO: APTREE~0 created #20071018195134
    (DB) INFO: APTREE~001 created #20071018195134
    (DB) INFO: APTREET created #20071018195134
    (IMP) INFO: import of APTREET completed (272 rows) #20071018195134
    DbSl Trace: Error in exec_immediate()
    DbSl Trace: ORA-1452 occurred when executing SQL statement (parse error offset=35)
    (DB) ERROR: DDL statement failed
    (CREATE UNIQUE INDEX "APTREET~0" ON "APTREET" ( "SPRAS", "ID", "NAME" ) TABLESPACE PSAPBW1 STORAGE (INITIAL 44981 NEXT 0000000040K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) )
    DbSlExecute: rc = 99
    (SQL error 1452)
    error message returned by DbSl:
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    (DB) INFO: disconnected from DB
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: job finished with 1 error(s)
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: END OF LOG: 20071018195134
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: START OF LOG: 20071018195314
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: sccsid @(#) $Id: //bas/640_REL/src/R3ld/R3load/R3ldmain.c#12 $ SAP
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: version R6.40/V1.4
    Compiled Nov 30 2005 20:41:21
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe -dbcodepage 4103 -i C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.cmd -l C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\ORA\NUC\DB/SAPSSRC.log -stop_on_error
    DbSl Trace: ORA-1403 when accessing table SAPUSER
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): WE8DEC
    (DB) ERROR: DDL statement failed
    (DROP INDEX "APTREET~0")
    DbSlExecute: rc = 103
    (SQL error 1418)
    error message returned by DbSl:
    ORA-01418: specified index does not exist
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    DbSl Trace: Error in exec_immediate()
    DbSl Trace: ORA-1452 occurred when executing SQL statement (parse error offset=35)
    (DB) ERROR: DDL statement failed
    (CREATE UNIQUE INDEX "APTREET~0" ON "APTREET" ( "SPRAS", "ID", "NAME" ) TABLESPACE PSAPBW1 STORAGE (INITIAL 44981 NEXT 0000000040K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) )
    DbSlExecute: rc = 99
    (SQL error 1452)
    error message returned by DbSl:
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    (DB) INFO: disconnected from DB
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: job finished with 1 error(s)
    C:\usr\sap\BW1\SYS\exe\run/R3load.exe: END OF LOG: 20071018195315
    I'm getting this error "duplicate keys found". I'm finished installing the central instance and during the database instance, i got this error. I'm installing BW 3.5 on x64 windows server 2003 platform. I'm using NU kernel 6.40.
    Thanks for your suggestions on how to resolve this error.
    Reward points guaranteed.

    Issue solved by deleting central and database instance and started a new build. it finished without an error.
    Thank you.

  • W_PARTY_D_U1 = ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found.

    Hi,
    We are implementing OBIA 11.1.1.7.1 which comes with ODI for Fianance and Procurement analytics.When we do full load from EBS the load plan gets failed and it throws the below error
    Caused By: java.sql.SQLException: ORA-20000: Error creating Index/Constraint : W_PARTY_D_U1 => ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found.
    Please help us to resolve the same.
    Thanks
    Rama

    This might need Patch:10402735
    if helps mark

  • [b]ORA-02299 : duplicate keys found[/b]

    When I create my first CUBE in ORACLE 9.2.0.5 on my windows 2000 server,the cube wizard wrote this error message :
    ORA-02299:cannot validate(JANCO.UK_ON_0CASOVA_ID_DIMENZIA)-duplicate keys found
    I dont know , why cube wizrad wrote "duplicate keys found",because my foreign key between dimension table and fact table was unique.
    My SQL code generated by cube wizard :
    begin cwm_utility.set_object_in_error(null, null, null, null);
    end;
    ALTER TABLE JANCO.DIMENZIA
         ADD(CONSTRAINT UK_ON_0CASOVA_ID_DIMENZIA UNIQUE(ID))
    ALTER TABLE JANCO.PREMENNA
         ADD CONSTRAINT FK_ON_0CASOVA_ID_PREMENNA FOREIGN KEY(ID)
         REFERENCES JANCO.DIMENZIA(ID) RELY DISABLE NOVALIDATE
    declare CASOVA number;
    tmp number;
    begin
    CWM_OLAP_CUBE.Create_Cube('JANCO', 'LANOVKA', 'LANOVKA', '');
    CASOVA := CWM_OLAP_CUBE.Add_Dimension('JANCO', 'LANOVKA', 'JANCO', 'CASOVA', 'CASOVA');
    CWM_OLAP_CUBE.Map_Cube('JANCO', 'LANOVKA', 'JANCO', 'PREMENNA', 'FK_ON_0CASOVA_ID_PREMENNA', 'ID', 'JANCO', 'CASOVA', 'CASOVA');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'DIFERENCIA_TENZOMETROV', 'DIFERENCIA TENZOMETROV', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'DIFERENCIA_TENZOMETROV', 'JANCO', 'PREMENNA', 'DIFERENCIA_TENZOMETROV');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'DOLNA_HRANICA_POLOHY', 'DOLNA HRANICA POLOHY', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'DOLNA_HRANICA_POLOHY', 'JANCO', 'PREMENNA', 'DOLNA_HRANICA_POLOHY');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'HORNA_HRANICA_POLOHY', 'HORNA HRANICA POLOHY', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'HORNA_HRANICA_POLOHY', 'JANCO', 'PREMENNA', 'HORNA_HRANICA_POLOHY');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'LAVY_TENZOMETER', 'LAVY TENZOMETER', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'LAVY_TENZOMETER', 'JANCO', 'PREMENNA', 'LAVY_TENZOMETER');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'PRAVY_TENZOMETER', 'PRAVY TENZOMETER', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'PRAVY_TENZOMETER', 'JANCO', 'PREMENNA', 'PRAVY_TENZOMETER');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'SKUTOCNA_POLOHA', 'SKUTOCNA POLOHA', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'SKUTOCNA_POLOHA', 'JANCO', 'PREMENNA', 'SKUTOCNA_POLOHA');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'TOLERANCIA_POLOHY', 'TOLERANCIA POLOHY', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'TOLERANCIA_POLOHY', 'JANCO', 'PREMENNA', 'TOLERANCIA_POLOHY');
    CWM_OLAP_MEASURE.Create_Measure('JANCO', 'LANOVKA', 'ZIADANA_POLOHA', 'ZIADANA POLOHA', '');
    CWM_OLAP_MEASURE.Set_Column_Map('JANCO', 'LANOVKA', 'ZIADANA_POLOHA', 'JANCO', 'PREMENNA', 'ZIADANA_POLOHA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'DIFERENCIA_TENZOMETROV', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'DOLNA_HRANICA_POLOHY', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'HORNA_HRANICA_POLOHY', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'LAVY_TENZOMETER', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'PRAVY_TENZOMETER', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'SKUTOCNA_POLOHA', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'TOLERANCIA_POLOHY', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    tmp:= cwm_utility.create_function_usage('SUM');
    cwm_olap_measure.set_default_aggregation_method('JANCO', 'LANOVKA', 'ZIADANA_POLOHA', tmp, 'JANCO', 'CASOVA', 'CASOVA');
    commit;
    end;
    Please help me :) Thanx very much
    JOHN

    It appears to be a data issue. The ID column in JANCO.DIMENZIA has duplicate values.

  • Runtime error - duplicate key found

    Dear Techies,
      i have a strange issue here.
    I am writing a stadard internal table to sorted table.
    Though there are no duplicate entries,
    my itab_s[] = itab[]          gives a dump saying ITAB_DUPLICATE_KEY
      What could be the reason.
      how to check which record gives the dump from ST22.
    regards
    Imran.

    There are no duplicates. Just checked for the data in the dump. For the objects it is returning the dump, i tried deleting those in the source internal table through debugging, but i dint fetch me any result
      00101D 701069961021    1  2010052199991231          00020100521I039246        00000000#####
      3333342333333333333222232233333333333333332222222222333333333334333333222222223333333300000222
      001014070106996102100001002010052199991231000000000000020100521903924600000000000000000000C000
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      3000300031003000310044002000370030003100300036003900390036003100300032003100200020002000200031
      00101D 701069971021    1  2010052199991231          00020100521C5137023       00000000#####BGN
      3333342333333333333222232233333333333333332222222222333333333334333333322222223333333300000444
      001014070106997102100001002010052199991231000000000000020100521351370230000000000000000000C27E
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      3000300031003000310044002000370030003100300036003900390037003100300032003100200020002000200031
      00101D 701069981021    1  2010052199991231          00020100521C5137023       00000000#####BGN
      3333342333333333333222232233333333333333332222222222333333333334333333322222223333333300000444
      001014070106998102100001002010052199991231000000000000020100521351370230000000000000000000C27E
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      3000300031003000310044002000370030003100300036003900390038003100300032003100200020002000200031
    I have deleted the above entries from the internal table.
    Regards
    Imran.

  • Cannot CREATE UNIQUE INDEX; duplicate keys found

    I have 10g when I did an expdp from prod (an AIX 5.3 ) and impdp to a test (a RHEL3 ) with TABLE_EXISTS_ACTION=TRUNCATE, there are some index errors ORA-01452 for some of the tables but not all. As I compared the difference between , The only difference I noticed was that the one with error is the table has data, those tables without error have no data. So how which parameter I can use in impdp to avoid ? read the utility doc, have not found clear picture.
    Chi

    In 11510,
    The duplicate row loaded is person 6272 with effective date 1994 and 1991. This needs to be fixed in vision.
    Workflow SIL_PositionDimension_Full calls mapping SIL_PositionDimension to load target W_POSITION_D from source W_POSITION_DS. W_POSITION_D.INTEGRATION_ID maps to W_POSITION_DS.INTEGRATION_ID, but EFFECTIVE_FROM_DT is a more complicated many to one mapping.
    Extract to W_POSITION_DS ;
    SDE_ORA_PositionDimension_NonEmployee
    - W_POSITION_DS.INTEGRATION_ID from PER_ALL_PEOPLE_F.PERSON_ID
    SDE_ORA_PositionDimension_NoAssignments
    - W_POSITION_DS.INTEGRATION_ID from JTF_RS_RESOURCE_EXTNS_TL RESOURCE_ID
    -- PER~6272,4,01-JAN-94
    -- PER~6272,4,01-JAN-91
    select all t.*
    from
    select all
    count(*) as n
    , t.INTEGRATION_ID
    , t.DATASOURCE_NUM_ID
    , t.EFFECTIVE_FROM_DT
    --, t.*
    from baw.W_POSITION_D t
    group by
    null
    , t.INTEGRATION_ID
    , t.DATASOURCE_NUM_ID
    , t.EFFECTIVE_FROM_DT
    ) t
    where ( ( n > 1 ) )
    ;

  • Error in Executing a Interface -- Index Duplicate Keys

    Hi All,
    I ran my Interface 2 times , it was working fine..... but after that when I ran I got these Error...where I am doing the mistake.............
    KM I used :
    LKM SQL to ORACLE
    IKM ORACLE INCREEMENTAL UPDATE
    CKM ORACLE
    The Step I am getting this Error is : Create Unique Index on Flow Table
    1452 : 72000 : java.sql.SQLException: ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    java.sql.SQLException: ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Thanks
    AK
    Message was edited by:
    Ananda

    Hi Anand-
    This is completely data issue, when executing the unique index step it will create unique index with the column name you mentioned.
    When you ran the first two loads there was no duplicate keys found in the data that's why you didn't get the error but the third run you got the problem.
    Check your data records and made changes in the KM as Bouch told if you don't want to create unique index.
    Thanks & Regards,
    Saravanan Rajavel

  • Duplicate key

    Hi how to find duplicate in table
    so solve this problum
    SQL> alter table product add constraint prod_name_uk unique(prod_name);
    alter table product add constraint prod_name_uk unique(prod_name)
    ERROR at line 1:
    ORA-02299: cannot validate (ZENSOL1.PROD_NAME_UK) - duplicate keys found
    Thanks And Regards
    vikas Singhal

    Use exception clause when altering table to find the exceptions.
    READ
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_3001.htm
    exceptions_clause
    This clause is valid only if the partitioned table has been defined with a UNIQUE constraint, and that constraint must be in DISABLE VALIDATE state. Specify a table into which Oracle Database places the rowids of all rows violating the constraint. If you omit schema, then the database assumes the exceptions table is in your own schema. If you omit this clause altogether, then the database assumes that the table is named EXCEPTIONS. The exceptions table must be on your local database.
    You can create the EXCEPTIONS table using one of these scripts:
    UTLEXCPT.SQL uses physical rowids. Therefore it can accommodate rows from conventional tables but not from index-organized tables. (See the Note that follows.)
    UTLEXPT1.SQL uses universal rowids, so it can accommodate rows from both heap-organized and index-organized tables.
    If you create your own exceptions table, then it must follow the format prescribed by one of these two scripts.
    If you are collecting exceptions from index-organized tables based on primary keys (rather than universal rowids), then you must create a separate exceptions table for each index-organized table to accommodate its primary key storage. You create multiple exceptions tables with different names by modifying and resubmitting the script.
    SS

  • Master Delta Load - Error "38 Duplicate records found"

    Hi Guys,
    In one of our delta uploads for a Master data we are getting error "38 Duplicate records found". I checked the PSA data but there were no duplicate records in that.
    Once the data upload fails I manually update the failed packet and it goes fine.
    Please any one have solution for this.

    Hi
    You can see the check box in the Processing tab page. Make a tick mark for the check box Ignore Duplicate Data Records indicator . When multiple data records that have the same key are transferred, the last data record in the request is updated to BI. Any other data records in the request with the same key are ignored.
    Help says that:
    To maintain consistency, ignoring duplicate data records is only possible if the data is updated serially. A serial update is when data is first updated into the PSA then, after it has been successfully written to the PSA, it is updated into the master data or text tables of the InfoObject.
    If a DataSource transfers potentially duplicate data records or if you manually set the Ignore Duplicate Data Records indicator, the PSA Only update type is automatically selected in the scheduler.
    hope it clears ur doubt, otherwise let me know.
    u can see the same in my previous thread
    Re: duplicate records found while loading master data(very urgent)
    Regards
    Kiran

  • Error while Upgrading 7.6 to 2007A - duplicate key in object 'dbo.NNM1'

    Hello,
    We are trying to upgrade our client from SBO 7.6 SP01 to SBO 2007 SP01 version (It is supported by sap to skip 2004 version)
    Upgrade ends with the following error:
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.NNM1' and the index name 'NNM1_PRIMARY'. The duplicate key value is (0).
    I can see with profiler, that upgrader is trying to do the following query:
    ALTER TABLE [dbo].[NNM1]  ADD CONSTRAINT [NNM1_PRIMARY] PRIMARY KEY (Series)
    As I can see, in SBO 7.6 nnm1 table numbering was different than in the new versions (for example 2007A) u2013
    In 7.6 ver. Numbering in  u201Cseriesu201D column was starting from 0 within certain object, hereu2019s example:
    <Objectcode>     <series>         <seriesname>
    ___17     __________0___     sales_order_series1
    ___17          __________1___     sales_order_series2
    ___17          __________2          ___sales_order_series3
    ___15          __________0          ___delivery_series1
    ___15          __________1          ___selivery_series2
    In SAP 2007A version column series has unique values so for above example it should be:
    <Objectcode>     <series>         <seriesname>
    ___17          __________0___          sales_order_series1
    ___17          __________1___          sales_order_series2
    ___17          __________2___          sales_order_series3
    ___15          __________3___          delivery_series1
    ___15          __________4___          selivery_series2
    Anyone had that problem while upgrading from 7.6 to 2007A (or maybe from 7.6 to 2004?).

    Dear Daniel,
    Reported upgrade issue needs a further investigation therefore please log a support message with a component SBO-BC-UPG via the Service Market Place.
    Please also attach 'UpgradeLog' files to the message. You will find the log files in the same directory as your B1 client (b1loggerPidxxxx_xxxxxxxxxxxxxx.txt; B1UpgradePidxxxx_xxxxxxxxxxxxxx.txt)
    Regards,
    Ladislav Meszaros
    SAP Business One Forum Team

  • Private Key Not Found Error in Ldaps

    Hi,
    I am facing "Private Key Not Found" Error in ldaps. The key and the SSL certificate is stored under the same location. The certificate is self signed certificate and in .pem format. When I am trying to install the certifcate through SUN ONE Console it throws the following error
    "Either this certificate is for another server, or this certificate was not requested using this server".
    can any one help me in this regard.
    Regards
    Senthil
    Edited by: senlog80 on Dec 30, 2008 3:18 AM

    Or even better, check the note <a href="https://websmp110.sap-ag.de/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=924320&_NLANG=E">924320</a>.
    <b>Symptom</b>:
    When you execute a query with virtual characteristics or key figures, the system issues the following error message:
    Object FIELD I_S_DATA-<key figure> not found
    <b>Other terms</b>
    RSR00002, RSR_OLAP_BADI
    <b>Reason and Prerequisites</b>
    This problem is caused by a program error.
    <b>Solution</b>
    If the virtual characteristics or key figures are implemented using the enhancement RSR00002 (CMOD), implement the corrections.
    If the virtual characteristics or key figures were created directly as implementations of the RSR_OLAP_BADI BAdI, compare the source code of the INITIALIZE method with the corresponding source code example. During the call of GET_FIELD_POSITIION_D, <L_S_SK>-VALUE_RETURNNM must be transferred instead of <L_S_SFK>-KYFNM.
    Import Support Package 08 for SAP NetWeaver 2004s BI (BI Patch 08 or SAPKW70008) into your BI system. The Support Package is available when Note 0872280"SAPBINews BI 7.0 Support Package 08", which describes this Support Package in more detail, is released for customers.
    In urgent cases, you can use the correction instructions.
    To provide advance information, the note mentioned above may be available before the Support Package is released. In this case, the short text of the note still contains the words "Preliminary version".
    Assign pts if helpful.

  • Duplicate Facts found : Business Rule Error

    Hi ,
    I am trying to invoke the bunisess rules in loop, that means it has call the business rules decision service several times,
    from BPEL, In BPEL it loops correctly and first time it gives proper results , when looping second time I am getting
    the following error, I am not getting proper clue anywhere for this, plz chck this and let me know the solution for this
    asap. Thank you very much in advance.
    **ERROR**
    /xmlns.oracle.com/CheckXXX_BPEL/DecisionService_CheckXXX_PL">Error while executing a rule session unit of work, duplicate facts found.
    The rule session CheckXXX_BPEL:270012 failed because duplicate fact objects of the fact po.rules.BRSXXXValidation exists, cant identify which one to take.
    Check the underlying exception and correct the error. Contact oracle support if error is not fixable.
    </ns0:errorMessage>
    </ns0:errorInfo>
    </part></operationErroredFault>

    Hi
    Please note that you create rules using some facts . Those rules gets executed whenever it encounters those facts, intern they create more facts. These new facts generated as a result of executing the first rules, can be used in next rule and so on.... So, rules create facts, and those facts will willl fire new rules.
    The issue you have is due to having duplicate facts created and the rule not coded properly.
    You may refer : C.6 How Do I Correctly Use an RL Language Cross Product? in http://download.oracle.com/docs/cd/B31017_01/web.1013/b28965/faq.htm
    Hope this helps!
    Cheers
    Anirudh Pucha

  • 36 duplicate record  found. -- error while loading master data

    Hello BW Experts,
    Error while loading master data
    ( green light )Update PSA ( 50000 Records posted ) No errors
    ( green light )Transfer rules ( 50000  „³ 50000 Records ): No errors
    ( green light )Update rules ( 50000 „³ 50000 Records ): No errors
    ( green light ) Update ( 0 new / 50000 changed ): No errors
    ( red light )Processing end: errors occurred
         Processing 2 finished
    ƒÞ     36 duplicate record found. 15718 recordings used in table /BIC/PZMATNUM
    ƒÞ     36 duplicate record found. 15718 recordings used in table /BIC/XZMATNUM
    This error repeats with all the data-packets.
    what could be the reason of the error. how to correct the error.
    Any suggestions appreciated.
    Thanks,
    BWer

    BWer,
    We have exactly the same issue when loading the infoobject 0PM_ORDER, the datasource is 0PM_ORDER_ATTR.
    The workaround we have been using is 'Manual push' from the details tab of the monitor. Weirdly we don't have this issue in our test and dev systems, even in Production, this doesn't occur somedays. We have all the necessary settings enabled in the infopackage.
    Did you figure out a solution for your issue, if so please let me know and likewise I will.
    -Venkat

  • Inbound IDOC processing, error duplicate key

    We want to retrieve certain order-idocs in our system, before they are processed, to change AND insert segment data.
    Flow we use in our current program
    - DOC_STATUS_WRITE_TO_DATABASE
    to change the status of the idoc (ok) (status 69)
    - EDI_DOCUMENT_OPEN_FOR_EDIT (ok)
    - EDI_CHANGE_DATA_SEGMENTS (ok)
    - EDI_DOCUMENT_CLOSE_EDIT => not ok
    This program gives SAPSQL error
    Via debugging, we see that a new idoc number is
    called (save as backup idoc ?), but we want the
    current IDOC to be processed.
    The system wants to insert in EDID4 => dump :
    "Use an ABAP/4 Open SQL array insert only if you
    are sure that none of the records passed already
    exists in the database."
    ( I prefer to use these standard functions, in stead of just deleting and inserting into "EDID4" )
    regards,
    answers will be rewarded.
    code extract
    INCLUDE ZBE01458_TOP.
    INITIALIZATION.
    V_EDIT_STATUS = '69'.
    V_PROCESSED_STATUS = '32'.
    start-of-selection.
    clear t_edidc. refresh t_edidc.
    SELECT * FROM EDIDC into table t_edidc
    WHERE DOCNUM in S_docnum
    and mestyp in S_mestyp
    and idoctp in S_idoctp
    and credat in S_credat
    and rcvpor in S_rcvpor
    and rcvprt in S_rcvprt
    and rcvprn in S_rcvprn
    and sndpor in S_sndpor
    and sndprt in S_sndprt
    and sndprn in S_sndprn
    and status in S_status.
    loop at t_edidc.
    move t_edidc-docnum to v_docnum.
    refresh v_status.
    V_STATUS-docnum = V_DOCNUM.
    V_STATUS-status = V_EDIT_STATUS.
    clear EDIDS.
    select single * from EDIDS where docnum = v_docnum.
    if sy-subrc = 0.
    MOVE EDIDS-STACOD to V_STATUS-STACOD.
    endif .
    APPEND V_STATUS.
    PERFORM CHANGE_IDOC_STATUS tables V_STATUS USING V_DOCNUM.
    changing part for DEDIDD "idoc data
    PERFORM OPEN_IDOC_FOR_CHANGE.
    PERFORM CHANGE_IDOC.
    PERFORM CLOSE_IDOC_FOR_CHANGE.
    refresh v_status.
    V_STATUS-docnum = V_DOCNUM.
    V_STATUS-status = V_PROCESSED_STATUS.
    APPEND V_STATUS.
    PERFORM CHANGE_IDOC_STATUS tables V_STATUS
    USING V_DOCNUM.
    endloop.
    *& Form OPEN_IDOC_FOR_CHANGE
    text
    --> p1 text
    <-- p2 text
    FORM OPEN_IDOC_FOR_CHANGE.
    CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_EDIT'
    EXPORTING
    DOCUMENT_NUMBER = V_DOCNUM
    ALREADY_OPEN = 'N'
    IMPORTING
    IDOC_CONTROL =
    TABLES
    IDOC_DATA = DEDIDD
    EXCEPTIONS
    DOCUMENT_FOREIGN_LOCK = 1
    DOCUMENT_NOT_EXIST = 2
    DOCUMENT_NOT_OPEN = 3
    STATUS_IS_UNABLE_FOR_CHANGING = 4
    OTHERS = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " OPEN_IDOC_FOR_CHANGE
    *& Form CHANGE_IDOC
    text
    --> p1 text
    <-- p2 text
    FORM CHANGE_IDOC.
    CALL FUNCTION 'EDI_CHANGE_DATA_SEGMENTS'
    TABLES
    IDOC_CHANGED_DATA_RANGE = DEDIDD
    EXCEPTIONS
    IDOC_NOT_OPEN = 1
    DATA_RECORD_NOT_EXIST = 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.
    ENDFORM. " CHANGE_IDOC
    *& Form CLOSE_IDOC_FOR_CHANGE
    text
    --> p1 text
    <-- p2 text
    FORM CLOSE_IDOC_FOR_CHANGE.
    CLEAR t_EDI_DS40.
    t_edi_ds40-docnum = v_docnum.
    t_edi_ds40-status = '51'.
    t_edi_ds40-repid = sy-repid.
    t_edi_ds40-tabnam = 'EDI_DS'.
    t_edi_ds40-mandt = sy-mandt.
    t_edi_ds40-stamqu = 'SAP'.
    t_edi_ds40-stamid = 'B1'.
    t_edi_ds40-stamno = '999'.
    t_edi_ds40-stapa1 = 'Changes made to idoc ...'.
    t_edi_ds40-stapa2 = t_new_kunnr.
    t_edi_ds40-logdat = sy-datum.
    t_edi_ds40-logtim = sy-uzeit.
    APPEND t_edi_ds40.
    CALL FUNCTION 'EDI_DOCUMENT_CLOSE_EDIT'
    EXPORTING
    DOCUMENT_NUMBER = V_DOCNUM
    DO_COMMIT = 'X'
    DO_UPDATE = 'X'
    WRITE_ALL_STATUS = 'X'
    TABLES
    STATUS_RECORDS = t_EDI_DS40
    EXCEPTIONS
    IDOC_NOT_OPEN = 1
    DB_ERROR = 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.
    ENDFORM. " CLOSE_IDOC_FOR_CHANGE
    *& Form CHANGE_IDOC_STATUS
    text
    --> p1 text
    <-- p2 text
    FORM CHANGE_IDOC_STATUS tables P_IDOC_STATUS structure V_IDOC_STATUS
    USING P_DOCNUM.
    CALL FUNCTION 'IDOC_STATUS_WRITE_TO_DATABASE'
    EXPORTING
    IDOC_NUMBER = p_docnum
    IDOC_OPENED_FLAG = ' '
    NO_DEQUEUE_FLAG = 'X'
    IMPORTING
    IDOC_CONTROL =
    TABLES
    IDOC_STATUS = P_IDOC_STATUS
    EXCEPTIONS
    IDOC_FOREIGN_LOCK = 1
    IDOC_NOT_FOUND = 2
    IDOC_STATUS_RECORDS_EMPTY = 3
    IDOC_STATUS_INVALID = 4
    DB_ERROR = 5
    OTHERS = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    commit work.
    ENDIF.
    ENDFORM. " CHANGE_IDOC_STATUS

    Urmila,
    I tried this sequence : code extract follows...
    I got the duplicate key errors again.
    what about delete first and then insert again in EDID4 table ?
    source code extract:
    INCLUDE ZBE01458_TOP.
    INITIALIZATION.
      V_EDIT_STATUS = '69'.
      V_PROCESSED_STATUS = '32'.
      V_SAPCODE = 'SAPE0184'.
    start-of-selection.
      clear t_edidc. refresh t_edidc.
      SELECT  * FROM  EDIDC into table t_edidc
             WHERE  DOCNUM  in S_docnum
               and  mestyp  in S_mestyp
               and  idoctp  in S_idoctp
               and  credat  in S_credat
               and  rcvpor  in S_rcvpor
               and  rcvprt  in S_rcvprt
               and  rcvprn  in S_rcvprn
               and  sndpor  in S_sndpor
               and  sndprt  in S_sndprt
               and  sndprn  in S_sndprn
               and  status  in S_status.
      loop at t_edidc.
        move t_edidc-docnum to v_docnum.
        move-corresponding T_EDIDC to WA_EDIDC.
        V_STA-docnum      = v_docnum.
        V_STA-status      = '51'.
        V_STA-repid       = sy-repid.
        V_STA-tabnam      = 'EDI_DS'.
        V_STA-mandt       = sy-mandt.
        V_STA-stamqu      = 'SAP'.
        V_STA-stamid      = 'B1'.
        V_STA-stamno      = '999'.
        V_STA-stapa1      = 'Changes made to idoc ...'.
    t_edi_ds40-stapa2      = t_new_kunnr.
        V_STA-logdat      = sy-datum.
        V_STA-logtim      = sy-uzeit.
        V_STA-STACOD       =  V_SAPCODE.
        PERFORM OPEN_FOR_PROCESS.
        PERFORM SET_IDOC_STATUS USING V_DOCNUM V_STA.
        PERFORM CLOSE_IDOC_FOR_PROCESS.
        PERFORM OPEN_IDOC_FOR_CHANGE.
        PERFORM PROCESS_IDOC_STRUCTURE.
        PERFORM CHANGE_IDOC.
        PERFORM CLOSE_IDOC_FOR_CHANGE.
       refresh v_status.
       V_STATUS-docnum = V_DOCNUM.
       V_STATUS-status = V_EDIT_STATUS.
       V_STATUS-STACOD = V_SAPCODE.
       clear EDIDS.
       select single * from EDIDS where docnum = v_docnum.
       if sy-subrc = 0.
        MOVE EDIDS-STACOD to V_STATUS-STACOD.
       endif .
       APPEND V_STATUS.
       PERFORM CHANGE_IDOC_STATUS tables V_STATUS USING  V_DOCNUM.
      endloop.
    *&      Form  OPEN_IDOC_FOR_CHANGE
          text
    -->  p1        text
    <--  p2        text
    FORM OPEN_IDOC_FOR_CHANGE.
      CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_EDIT'
       EXPORTING
         DOCUMENT_NUMBER                     = V_DOCNUM
      ALREADY_OPEN                        = 'N'
    IMPORTING
       IDOC_CONTROL                        = WA_EDIDC
       TABLES
         IDOC_DATA                           = DEDIDD
      EXCEPTIONS
        DOCUMENT_FOREIGN_LOCK               = 1
        DOCUMENT_NOT_EXIST                  = 2
        DOCUMENT_NOT_OPEN                   = 3
        STATUS_IS_UNABLE_FOR_CHANGING       = 4
        OTHERS                              = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " OPEN_IDOC_FOR_CHANGE
    *&      Form  CHANGE_IDOC
          text
    -->  p1        text
    <--  p2        text
    FORM CHANGE_IDOC.
      CALL FUNCTION 'EDI_CHANGE_DATA_SEGMENTS'
           TABLES
                IDOC_CHANGED_DATA_RANGE = DEDIDD
           EXCEPTIONS
                IDOC_NOT_OPEN           = 1
                DATA_RECORD_NOT_EXIST   = 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.
    ENDFORM.                    " CHANGE_IDOC
    *&      Form  CLOSE_IDOC_FOR_CHANGE
          text
    -->  p1        text
    <--  p2        text
    FORM CLOSE_IDOC_FOR_CHANGE.
      CLEAR t_EDI_DS40.
      t_edi_ds40-docnum      = v_docnum.
      t_edi_ds40-status      = '69'.
      t_edi_ds40-repid       = sy-repid.
      t_edi_ds40-tabnam      = 'EDI_DS'.
      t_edi_ds40-mandt       = sy-mandt.
      t_edi_ds40-stamqu      = 'SAP'.
      t_edi_ds40-stamid      = 'B1'.
      t_edi_ds40-stamno      = '999'.
      t_edi_ds40-stapa1      = 'Changes made to idoc ...'.
    t_edi_ds40-stapa2      = t_new_kunnr.
      t_edi_ds40-logdat      = sy-datum.
      t_edi_ds40-logtim      = sy-uzeit.
      APPEND t_edi_ds40.
      CALL FUNCTION 'EDI_DOCUMENT_CLOSE_EDIT'
           EXPORTING
                DOCUMENT_NUMBER  = V_DOCNUM
                DO_COMMIT        = 'X'
                DO_UPDATE        = 'X'
                WRITE_ALL_STATUS = 'X'
           TABLES
                STATUS_RECORDS   = t_EDI_DS40
           EXCEPTIONS
                IDOC_NOT_OPEN    = 1
                DB_ERROR         = 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.
    ENDFORM.                    " CLOSE_IDOC_FOR_CHANGE
    *&      Form  CHANGE_IDOC_STATUS
          text
    -->  p1        text
    <--  p2        text
    FORM CHANGE_IDOC_STATUS tables P_IDOC_STATUS structure V_IDOC_STATUS
    USING P_DOCNUM.
      CALL FUNCTION 'IDOC_STATUS_WRITE_TO_DATABASE'
    EXPORTING
      IDOC_NUMBER                     = p_docnum
            IDOC_OPENED_FLAG                = ' '
            NO_DEQUEUE_FLAG                 = 'X'
          IMPORTING
            IDOC_CONTROL                    =
    TABLES
      IDOC_STATUS                     = P_IDOC_STATUS
          EXCEPTIONS
            IDOC_FOREIGN_LOCK               = 1
            IDOC_NOT_FOUND                  = 2
            IDOC_STATUS_RECORDS_EMPTY       = 3
            IDOC_STATUS_INVALID             = 4
            DB_ERROR                        = 5
            OTHERS                          = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      else.
        commit work.
      ENDIF.
    ENDFORM.                    " CHANGE_IDOC_STATUS
    *&      Form  OPEN_FOR_PROCESS
          text
    -->  p1        text
    <--  p2        text
    FORM OPEN_FOR_PROCESS.
      CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_PROCESS'
        EXPORTING
      DB_READ_OPTION                 = DB_READ
          DOCUMENT_NUMBER                = V_DOCNUM
      ENQUEUE_OPTION                 = SYNCHRONOUS
    IMPORTING
       IDOC_CONTROL                   = WA_EDIDC
    EXCEPTIONS
      DOCUMENT_FOREIGN_LOCK          = 1
      DOCUMENT_NOT_EXIST             = 2
      DOCUMENT_NUMBER_INVALID        = 3
      DOCUMENT_IS_ALREADY_OPEN       = 4
      OTHERS                         = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " OPEN_FOR_PROCESS
    *&      Form  SET_IDOC_STATUS
          text
    -->  p1        text
    <--  p2        text
    FORM SET_IDOC_STATUS USING P_DOCNUM P_STA.
      CALL FUNCTION 'EDI_DOCUMENT_STATUS_SET'
        EXPORTING
          DOCUMENT_NUMBER               = P_DOCNUM
          IDOC_STATUS                   = P_STA
    IMPORTING
       IDOC_CONTROL                  = WA_EDIDC
    EXCEPTIONS
      DOCUMENT_NUMBER_INVALID       = 1
      OTHER_FIELDS_INVALID          = 2
      STATUS_INVALID                = 3
      OTHERS                        = 4
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " SET_IDOC_STATUS
    *&      Form  CLOSE_IDOC_FOR_PROCESS
          text
    -->  p1        text
    <--  p2        text
    FORM CLOSE_IDOC_FOR_PROCESS.
      CALL FUNCTION 'EDI_DOCUMENT_CLOSE_PROCESS'
        EXPORTING
          DOCUMENT_NUMBER           = V_DOCNUM
      BACKGROUND                = NO_BACKGROUND
      NO_DEQUEUE                = ' '
    IMPORTING
       IDOC_CONTROL              = WA_EDIDC
    EXCEPTIONS
      DOCUMENT_NOT_OPEN         = 1
      FAILURE_IN_DB_WRITE       = 2
      PARAMETER_ERROR           = 3
      STATUS_SET_MISSING        = 4
      OTHERS                    = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " CLOSE_IDOC_FOR_PROCESS

Maybe you are looking for