Skip to main content

SAP Issue - "This entry already exists in the following tables"

Comments

8 comments

  • Morten Lilbæk Pedersen

    Update:
    We have received a workaround from a partner that can be used if you are in a hurry:
    "Deleting all object and boy tables will solve the problem. But is a lot of work."

    Update 2:
    A partner has gotten the following fix from SAP:

    Update ONNM Set AutoKey = (select MAX(DocEntry) + 1 from
    [@BOY_41_FUNCTIONS]) WHERE ObjectCode
    = 'BOY_41_FUNCTIONS'

    Please only use this and test databases. For live databases contact SAP support to verify the fix.

    0
  • Morten Lilbæk Pedersen

    Update 3: 
    A partner has gotten a fix and a SQL that detects the issue from SAP:

    /* Detect affected rows */

    SELECT A.ObjectCode, A.AutoKey, B.Autokey + 1
    FROM ONNM AS A
    JOIN (
    SELECT 'BOY_BUTTONS_EX' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_BUTTONS_EX] UNION ALL
    SELECT 'BOY_40_CONFIG' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_40_CONFIG] UNION ALL
    SELECT 'BOY_41_FUNCTIONS' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_41_FUNCTIONS] UNION ALL
    SELECT 'BOY_63_SCONFIG' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_63_SCONFIG] UNION ALL
    SELECT 'BOY_IPT' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_IPT] UNION ALL
    SELECT 'BOY_MANDATORY' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_MANDATORY] UNION ALL
    SELECT 'BOY_B1UP_USERGROUP' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_B1UP_USERGROUP]
    ) AS B ON A.ObjectCode = B.Objectcode AND A.Autokey <> (B.Autokey + 1)

    /* Correct affected rows */

    UPDATE A
    SET A.Autokey = (B.Autokey + 1)
    FROM ONNM AS A
    JOIN (
    SELECT 'BOY_BUTTONS_EX' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_BUTTONS_EX] UNION ALL
    SELECT 'BOY_40_CONFIG' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_40_CONFIG] UNION ALL
    SELECT 'BOY_41_FUNCTIONS' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_41_FUNCTIONS] UNION ALL
    SELECT 'BOY_63_SCONFIG' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_63_SCONFIG] UNION ALL
    SELECT 'BOY_IPT' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_IPT] UNION ALL
    SELECT 'BOY_MANDATORY' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_MANDATORY] UNION ALL
    SELECT 'BOY_B1UP_USERGROUP' AS [ObjectCode], MAX(DOCENTRY) AS [AutoKey] FROM [@BOY_B1UP_USERGROUP]
    ) AS B ON A.ObjectCode = B.Objectcode AND A.Autokey <> (B.Autokey + 1)

    Again please only use this and test databases. For live databases contact SAP support to verify the fix.

    0
  • Greg Lewis

    I get the following error when attempting update #3:

     

     

     

    0
  • Morten Lilbæk Pedersen

    Hi Greg,

    I have updated the SQL to be correct. It had one UNION ALL to many.

    1
  • Dave Gutman

    I'm getting same error:

    This entry already exists in the following tables  'Universal Functions' (@BOY_41_FUNCTIONS) (ODBC -2035)  [Message 131-183]

    when trying add a Universal Function on a 9.3 HANA system.

    Any word on the underlying cause?  And a resolution for live systems?

    0
  • Rasmus Jensen

    You can try to do a restore numbering file run but if that does not help you need to contact SAP Support. It is SAP them-self that mess up that tables and not our code :-(

    NB:

    (do the default UDO as instructed above to prove to them it is their issue (else they just blame the add-on)).

     

    0
  • Hugo van der Poel

    Restoring the Numbering file solved this problem for me (in HANA 9.2).

     

    0
  • Dave Gutman

    Restoring the numbering (under the advice of SAP Support) also solved my customer's issue.

    0

Please sign in to leave a comment.