ABAP/4 open SQL array results in dupl

Hi All,
The contract in SRM is not transferred to ECC. When checked the outbound queue through smq1, it says 'ABAP/4 open SQL array results in dupl ' for the program name given as SAPMSSY1. I learnt that this occurs when trying to insert a record in
the database and that record already exists with the same key. Debug didn't help and also searching for the relevant notes. Please suggest.
Thanks.
Regards,
Anuradha

Hi Anuradha,
please implement the note 1092012 into the backend system, and retest.
Eventually if you have a BAdI (e.g. the BBP_CTR) deactviate it also temporary to check the infulence.
Regards,
Peter

Similar Messages

  • The ABAP/4 Open SQL array insert results in duplicate database records

    Hi,
    Iam getting following error :
    The ABAP/4 Open SQL array insert results in duplicate database records.
    Error in ABAP application program.
    The current ABAP program "SAPLV60U" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    " Information on where terminated
    The termination occurred in the ABAP program "SAPLV60U" in "VBUK_BEARBEITEN".
    The main program was "SAPMSSY4 ".
    The termination occurred in line 503 of the source code of the (Include)
    program "LV60UF0V"
    of the source code of program "LV60UF0V" (when calling the editor 5030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "VBUK_BEARBEITEN" "(FORM)" but was not handled locally, not declared
    in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLV60U ". Its source code starts in line 469
    of the (Include) program "LV60UF0V "."
    Please assist how to proceed further ..
    Many thanks
    Mujeeb.

    Sorry, THe correct note is 402221.
    Description from the note
    << Please do not post SAP notes - they are copyrighed material >>
    Edited by: Rob Burbank on Feb 22, 2009 3:46 PM

  • ABAP/4 Open SQL array insert results in duplicate databaserecordsfor pk13

    Hi Experts, when I am working with pk13n tranaction iam getting an error message stating that update was terminated by user. when i am checking with st22 it gives the following message. please give the solution , iam sending the code as well.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
    in
    procedure "SAVE_DATA" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.) please find the below code please give the solution for this error message.
    1 *eject
    2 *----
    3 *   Verbuchen der Daten                                           *
    4 *----
    5 FORM SAVE_DATA.
    6
    7   DATA: lf_menge LIKE ekpo-menge VALUE 0,                   "717464
    8         lf_netwr LIKE ekpo-netwr VALUE 0.
    9
    10 * Einteilungen löschen --> Array Delete aus Tabelle DEKET
    11   DESCRIBE TABLE DEKET LINES SY-TFILL.
    12   IF SY-TFILL GT 0.
    13     DELETE EKET FROM TABLE DEKET.
    14     IF SY-SUBRC NE 0.
    15       MESSAGE A865.
    16     ENDIF.
    17     EKET_DELETE = EKET_DELETE + SY-DBCNT.
    18     REFRESH: DEKET.
    19     CLEAR  : DEKET.
    20   ENDIF.
    21
    22 * Einteilungen hinzufügen --> Array Insert aus Tabelle IEKET
    23   DESCRIBE TABLE IEKET LINES SY-TFILL.
    24   IF SY-TFILL GT 0.
    >>     INSERT EKET FROM TABLE IEKET.
    26     IF SY-SUBRC NE 0.
    27       MESSAGE A864.
    28     ENDIF.
    29     EKET_INSERT = EKET_INSERT + SY-DBCNT.
    30     REFRESH: IEKET.
    31     CLEAR  : IEKET.
    32   ENDIF.
    33
    34 * Check whether the qty in EKPO-MENGE is correct: note 717464
    35   SELECT SUM( menge ) FROM eket INTO lf_menge
    36                       WHERE ebeln = ekpo-ebeln
    37                       AND   ebelp = ekpo-ebelp.
    38   IF sy-subrc = 0 AND ekpo-menge <> lf_menge.
    39     IF ekpo-ktmng <> 0.
    40       refe1 = ekpo-zwert * lf_menge / ekpo-ktmng.
    41     ELSE.
    42       refe1 = ekpo-zwert * lf_menge / 1000.
    43     ENDIF.
    44     IF refe1 > maxwert.

    Hi,
    Well I don't know why you have duplicates, this is a functionnal issue. But you get the dump due the the message number 864 that triggers the abend... Changing the message type to 'E', 'S' or 'I' will prevent the dump but I guess this message has a good reason to be
    Kr,
    Manu.

  • The ABAP/4 Open SQL array insert results in duplicate Record in database

    Hi All,
    I am trying to transfer 4 plants from R/3 to APO. The IM contains only these 4 plants. However a queue gets generated in APO saying 'The ABAP/4 Open SQL array insert results in duplicate record in database'. I checked for table /SAPAPO/LOC, /SAPAPO/LOCMAP & /SAPAPO/LOCT for duplicate entry but the entry is not found.
    Can anybody guide me how to resolve this issue?
    Thanks in advance
    Sandeep Patil

    Hi Sandeep,
              Now try to delete ur location before activating the IM again.
    Use the program /SAPAPO/DELETE_LOCATIONS to delete locations.
    Note :
    1. Set the deletion flag (in /SAPAPO/LOC : Location -> Deletion Flag)
    2. Remove all the dependencies (like transportation lane, Model ........ )
    Check now and let me know.
    Regards,
    Siva.
    null

  • The ABAP/4 Open SQL array insert results in duplic

    Hi All,
        During monitoring of our SAP SRM system in SM58 transaction we have received the below error. Please advise on this.
    The ABAP/4 Open SQL array insert results in duplic
    SM58 for Wf-BATCH user
    SRM/MM: FM SPPF_PROCESS
    thanks and regards
    mohammed

    What action did you performed?

  • He ABAP/4 Open SQL array insert results in duplicate database records

    Dear Gurus,
    II am getting a dump when I run MD02/ MD03. (t- code to run MRP)
    Below is the message system is showing:
    Please help
    Thanks in Advance
    Best Regards
    Adhish
    Short text
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLM61U" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
    in
    procedure "INSERT_MDSBI_IN_MDSB" "(FORM)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    1 *----
    2 * ARRAY-INSERT auf MDSB
    3 *----
    4 FORM INSERT_MDSBI_IN_MDSB.
    INSERT MDSB6 FROM TABLE MDSBI.
    7 ADD SY-DBCNT TO STATS-RESBI. "statistics
    8 ENDFORM.

    Hi,
    There must be inconsistency in the number range. This happens when the current number in the number range for dependent requirements is lower than the highest number in the database table of the dependent requirements RESB.
    Please check the current number in transaction OMI2. Here in the interval you can see the current number. Then please check the highest number in table RESB. If the current number in OMI2 is lower than the highest number in table RESB then this should be the reason for the dump.
    Check and revert. If that's not the case we'll look into other possibilities.
    In mean time check for SAP Note 138108.

  • ABAP/4 Open SQL array insert results in duplicate database records in SM58

    Hi Everyone,
    I am testing a file to idoc scenario in my Quality system. When I passed the input file, the mapping executed successfully and there are no entries in SMQ2 but still the idoc wasn't created in the ECC system. When I have checked in TRFC, I am getting the error  ABAP/4 Open SQL array insert results in duplicate database records for IDOC_INBOUND_AYNCHRONOUS function module. I thought this is a data issue and I have tested with a fresh data which was never used for testing in Quality but even then I am getting the same error.Kindly advise.
    Thanks,
    Laawanya

    use FM idoc_status_write_to_database to change the IDoc status from 03 to 30 and then  run WE14 or  RSEOUT00 to change the status back to 03
    resending idoc from status 03 ...is a data duplicatino issue on receiving side...why do u need to do that ?
    Use WE19 tcode to debug
    In we19
    1)U can choose your Idoc number in existing Idoc textbox
    2)Press execute
    3)u will display ur Idoc struct
    4)Dbl click on any field then u can modify its content
    5)PressStd Outbound Processing Btn to process modified Idoc
    Thats it

  • Error: The ABAP/4 Open SQL array insert results in duplic in EWM

    Hi Friends,
    During outbound process in EWM, my completed EWM delivery gets stuck in SMQ1 with error "The ABAP/4 Open SQL array insert results in duplic". I performed following checks and found all the ok. Please help me with your insights.
    - Checked the Master data Products, Business Partners,are CIFed properly. Yes they are done properly.
    - Checked if inbound is stuck in same way. But its not.
    - Checked if there is any enhancement stopping in ECC. There is some enhancement in Document_save in ECC outbound delivery which I got it commented. Still the problem is same.
    Please suggest what could be the root cause.
    Thanks
    Trivedi

    Hi Rushikesh,
    I checked all Number ranges (O/D in EWM and ECC, HU and Batches). All are ok. I tried taking help of ABAPer to see if any Run time errors occuring but no use.
    Regards,
    Trivedi

  • The column name "PERNR" has two meanings. ABAP/4 Open SQL statement.

    Hi All,
    Could anyone advise on what are the error I encountered at below code.
    I get the error in " The column name "PERNR" has two meanings. ABAP/4 Open SQL statement." . This errors happen to all the key fields I have selected in below code (eg: pernr, subty, objps, sprps, begda, endda, seqnr).
    The field zeih also encountered error in "Unknown column name "ZEIH". not determined until runtime, you cannot specify a field list."      
      SELECT  pernr
                   subty
                   objps
                   sprps
                   begda
                   endda
                  seqnr
                  zlsch
                  ZEIH
      SELECT * INTO CORRESPONDING FIELDS
              OF TABLE  i_pa0009
              FROM pa0001 INNER JOIN pa0009
              ON pa0001pernr = pa0009pernr
              WHERE bukrs IN s_code AND
              banks NE space.

    Hi,
    In this query
    SELECT pernr
    subty
    objps
    sprps
    begda
    endda
    seqnr
    zlsch
    ZEIH
    if you have used joins and if both the database pa0001, pa0009 has the above mentioned fields you will get the error message as the control gets confused as to which table of the field you are referring to..., instead use them in this way
    SELECT pa0001~pernr
    for each field mention to which table it belongs and ~ before the field name in the above fashion, this will remove the error
    Regards,
    Siddarth

  • ABAP/4 Open SQL statement with WHERE ... LIKE and pattern too long

    Dear All,
    I am getting an error "ABAP/4 Open SQL statement with WHERE ... LIKE and pattern too long" while executing the following statement:
    CLEAR LS_RANGE.
    LS_RANGE-SIGN     = 'I'
    +LS_RANGE-OPTION     = 'CP'     +
    LS_RANGE-LOW     = 'S_ADMI_FCD'
    LS_RANGE-HIGH     = 'S_ADMI_FCD'
    COLLECT LS_RANGE INTO LT_RANGE.
    SELECT *
               FROM UST12
               INTO CORRESPONDING FIELDS OF TABLE LT_OBJECT_VALUES
               WHERE FIELD IN LT_RANGE
               AND AKTPS   = 'A'.
    For options like BT(Between), EQ(Equal) in range table, this above query is executing without dump. But for option CP, it simply dumps & in dump what i found is, it is concatenating the value in low & high.
    Does anyone have any idea regarding open sql using range tables.
    Thanks,
    Bhupinder

    Hi,
    I commented as follows:
    If  LS_RANGE-HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions. Yet operators CP and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields. If wildcards are entered on the selection screen, the system automatically uses the operator CP.
    If  LS_RANGE-HIGH  is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN and NOT BETWEEN that you use when you check if a field belongs to a range. You cannot use wildcard characters.
    You can try:
    CLEAR LS_RANGE.
    LS_RANGE-SIGN = 'I'.
    +LS_RANGE-OPTION = 'CP' +
    LS_RANGE-LOW = 'S_ADMI_FCD'.
    LS_RANGE-HIGH = 'S_ADMI_FCD'.
    FIND '*' IN LS_RANGE.
    IF sy-subrc = 0.
      LS_RANGE-OPTION = 'CP'.
    ELSE.
      LS_RANGE-OPTION = 'EQ'.
    ENDIF.
    COLLECT LS_RANGE INTO LT_RANGE.
    SELECT *
    FROM UST12
    INTO CORRESPONDING FIELDS OF TABLE LT_OBJECT_VALUES
    WHERE FIELD IN LT_RANGE
    AND AKTPS = 'A'.
    If you use wildcards the LS_RANGE  length should not exceed 10 characters.
    Hope this information is help to you.
    Regards,
    José

  • OPEN SQL performance question

    Hi friends,
    I'm going to read and process data in an interface coded in ABAP and OPEN SQL. To improve efficiency and reliability I'm processing the data in packets of a fixed size of rows - reading rows up to a predetermined numer into an internal table which then is processed and then finaly written back to database followed by "commit work". Then the process will continue with reading the next fixed number of rows, process them, and so on ...
    The general question is, which is the most efficient way to implement this scenario?
    I think of two basic approaches:
    1.1) Loop over results from a cursor using FETCH NEXT CURSOR inside a LOOP appending the lines to the internal table.
    2.1) Execute SELECT ... INTO TABLE <itab> FROM <table> UP TO <data packet size> ROWS.
    My assumtion is that approach 2 would be the more effecient, is that correct?
    The processed data will be written back to the database in one single statement:
    2.2) INSERT <table> FROM TABLE <itab>
    Which I assume is more efficient than doing the same using multiple inserts within a loop?
    Regards,
    Christian

    In native SQL you can also use the packet options.
    SELECT  <Fields name>      appending corresponding fields of table <Internal table>
                <b>package size 20000</b>
                FROM <Database table name>
                WHERE <Condition>.
    ENDSELECT.
    By using this the system will fetch the records from database table in packets [20000 records per package]
    Regards
    Aman

  • To fetch 2 fileds of table TRFCQIN (abap schema table ) through OPEN SQL

    Hi Experts,
    My basis team wants me to write a OPEN sql statement in DB2 . T
    The Open SQL statement for reading data from database tables is:
    SELECT      <result>
      INTO      <target>
      FROM      <source>
      [WHERE    <condition>]
      [GROUP BY <fields>]
      [HAVING   <cond>]
      [ORDER BY <fields>].
    I want to fetch 2 fileds of table TRFCQIN (abap schema table ) through OPEN SQL in report RSORADJV  in PI .
    As per PI basis comment : To use u201CRSORADJVu201D you need write the code in open SQL. If the code had been written in open SQL in the first place you wouldnu2019t be having to translate this from MS SQL.
    Can you pls help in writing open sql with above syntax .
    Initially when I wrote as
    QL statement : select * from SAPDBSR3.XI_AF_MSG, I got the error messege as
    Error : insufficient priviliage to access specified  table.
    Again basis suggested to write this code in OPen SQL statement .
    Please suggest., I dont know open SQL for the same.
    Regards,
    Arnab.

    Hi,
    Well I don't know why you have duplicates, this is a functionnal issue. But you get the dump due the the message number 864 that triggers the abend... Changing the message type to 'E', 'S' or 'I' will prevent the dump but I guess this message has a good reason to be
    Kr,
    Manu.

  • Cross Join in ABAP Open SQL

    Hi guys!
    I need to implement a CROSS JOIN (cartesian product) based on two tables. To my understanding there is no construct to implement a cross join in OPEN SQL. So the question is first is this correct? And secondly in which way would you then implement a cross join of two tables with the constructs at hand in ABAP?
    I have come up with the following solution of cross joining two tables, but would like to know if there is a better (not so ugly way).
    Example:
    SELECT * FROM tab1 AS t1 JOIN tab2 AS t2 ON t1mandt = t2mandt INTO CORRESPONDING FIELDS OF itab.
    Note that this only works if the tables tab1 and tab2 is client dependent.
    Regards,
    Christian

    Christian,
      There's no cross join construct in abap. Join statement results in a cartesin product rarely because of completely obsolete statistics missing selection or join conditions.
    Try the following join to get result similar to cartesian product
    select tab1location tab2matnr into itab
      from tab1 join tab2 on tab1location ne tab2matnr.
    if you really want to implement cross join, use native sql, try the following code,
    beware of cartesian products, Basis folks doesn't like em....
    data: begin of itab occurs 0,
      loc like tab1-sloc
      matnr like tab2-matnr,
    end of itab.
    exec sql performing append_itab.
      select a.loc, b.matnr
        into :itab
        from tab1 a
        cross join tab2 b
    endexec.
    form append_itab.
      append itab.
    endform.               
    Regards
    Sridhar.

  • CREATE VIEW in ABAP (Open SQL or Native SQL)

    Hi all you experts!
    I want to create a VIEW in ABAP. I have created Table Views using ABAP Dictionary (in transaction SE11), I don't have any problem with them.
    But, what I need is to create a dynamic view, I mean, a view that can be created/replaced (or modified) at runtime. Is this possible with SAP Open SQL, I don't think so... that is why I tried to created using native SQL but it is not working.
    Here is the code:
      EXEC SQL.
        CREATE VIEW [ZMXRFIV_GLPCA]
          AS SELECT
             T1.GL_SIRID,
             T1.POPER,
             T1.RBUKRS,
             T1.RPRCTR,
             T1.RACCT,
             T1.HSL
          FROM
             GLPCA T1
          INNER JOIN
             SKA1 T2
          ON
             T1.RACCT = T2.SAKNR
          WHERE
            T1.RVERS      =  '000'
            AND T1.RYEAR  =  '2008'
            AND T1.KOKRS  =  'PI01'
            AND T2.KTOPL  =  'PI00'
            AND T2.XBILK  <> 'X'.
      ENDEXEC.
    I have tried using quotes (") for the view name, parenthesis and even using only the name but this make no difference.
    Do any of you experts have any idea?
    PS: After creating the view I need to do a SELECT INTO TABLE to that view and finally delete this view and continue working with the data on the internal table.

    Hi ,
    oh yes it is an object (well, how the database should handle it in any context if it wasn't)
    i.e. for ORACLE you would have several thousands of them:
    select count(*) from dba_objects where object_type ='VIEW'
    If you avoid some kind of foreground processing (i.e. pull the data over the network) and handle the processing inside the database it can improve somehow performance a little (i.e. using the retieved rows of the view to stuff into a database table directly). But his may not always possible...
    bye
    yk

  • ABAP Open SQl or EXEC SQL

    1.     I want to do following:
    Select material_no  from mara where material_type in (u2018XXXu2019, u2018YYYu2019, u2018ZZZu2019)
    Where material_no, mateial_type will re replaced by the actual field names.
    Is it possible to do that in OPEN SQL or do I have to use native SQL u2013 EXCE SQL in my case Oracle SQL.
    2.     I have to refer to material type in (u2018XXXu2019, u2018YYYu2019, u2018ZZZu2019) in several sql querie in ABAP, so is it possible to move this code an ABAP function e.g., allowed_mattypes which will true or false
    , so I say
    Where allowed_mattypes(materail_type) = true.
    Once again can it be done in OPEN SQL or in EXEV SQL.
    3. Is there any disadvantage to using EXEC SQL; I know my database Oracle is not going to change and I am qite familiar with EZEC SQL.
    THnaks a lot

    Hi ,
    oh yes it is an object (well, how the database should handle it in any context if it wasn't)
    i.e. for ORACLE you would have several thousands of them:
    select count(*) from dba_objects where object_type ='VIEW'
    If you avoid some kind of foreground processing (i.e. pull the data over the network) and handle the processing inside the database it can improve somehow performance a little (i.e. using the retieved rows of the view to stuff into a database table directly). But his may not always possible...
    bye
    yk

Maybe you are looking for

  • mx:Image no image preview in Design Mode

    Inside my Flash Builder (4.01) AIR project, the image preview in design mode for the mx:Image component does not show the image set with the source attribute. This seems to be a project specific problem. When I create a new project , insert mx:image

  • 450 MHz G4 Approaching the end of its Line... or Not?

    450 MHz is not fast by any stretch I know, but for 5 years this machine has served me well and been 100% reliable. My G4 Cube is stock except for a 120GB HD, maxxed out RAM and Panther 10.3.9. Some common Photoshop chores on my very large files (200

  • Exit program after new-page

    Hi, What could be wrong with folowing code (part of longer program) : FORM print_id.   DATA: valid TYPE c,         params LIKE pri_params.      CALL FUNCTION 'GET_PRINT_PARAMETERS'       EXPORTING         destination = 'LOCL'         immediately = 'X

  • How we generate Surrogate Keys without using identify column

    Hi All, How we generate Surrogate Keys without using identify column. Regards, Manish

  • Compare code between systems

    Hi all, I need to compare the code of a report between our test and development systems.  I know SE39 will do a compare but when I run se39 in DL2 (development) I can't see TL2(test system) in the list.  The same happens when I run se39 in TL2, I can