How To Fix AD273 - Foreign key &-& does not originate from foreign key table &


SAP Error Message - Details

  • Message type: E = Error

  • Message class: AD - Data Dictionary application messages

  • Message number: 273

  • Message text: Foreign key &-& does not originate from foreign key table &

  • Show details Hide details
  • What causes this issue?

    You have selected a foreign key field, which is not in the foreign key
    table.

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.

    System Response

    How to fix this error?

    When checking the foreign key against the check table on a screen, make
    sure that this field fits the current contents of the foreign key table.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message AD273 - Foreign key &-& does not originate from foreign key table & ?

    The SAP error message AD273 indicates a foreign key constraint violation. This error occurs when you attempt to insert or update a record in a table that references a foreign key, but the value you are trying to insert does not exist in the corresponding foreign key table.

    Cause:

    1. Missing Foreign Key Entry: The value you are trying to insert or update in the child table does not exist in the parent table (the table that the foreign key references).
    2. Incorrect Configuration: The foreign key relationship may not be correctly defined in the database schema.
    3. Data Integrity Issues: There may be data integrity issues where the data in the child table is not aligned with the parent table.

    Solution:

    1. Check Foreign Key Values: Ensure that the value you are trying to insert or update in the child table exists in the parent table. You can do this by querying the parent table to see if the corresponding key exists.

      SELECT * FROM parent_table WHERE foreign_key_column = 'value_you_are_trying_to_insert';
    2. Insert Missing Parent Record: If the value does not exist in the parent table, you need to insert the corresponding record into the parent table before performing the operation on the child table.

    3. Review Foreign Key Constraints: Check the foreign key constraints defined in the database to ensure they are set up correctly. You can do this by reviewing the table definitions in the database.

    4. Data Cleanup: If there are orphaned records in the child table (records that reference non-existent parent records), you may need to clean up the data by either deleting or updating those records.

    5. Consult Documentation: If you are unsure about the foreign key relationships, consult the SAP documentation or your database schema documentation for more details on the relationships between the tables.

    Related Information:

    • Transaction Codes: You can use transaction codes like SE11 (Data Dictionary) to view and manage table definitions and foreign key relationships.
    • Debugging: If you are developing or customizing an application, you may want to debug the code to see where the foreign key violation is occurring.
    • SAP Notes: Check SAP Notes for any known issues or patches related to foreign key constraints in your specific version of SAP.

    By following these steps, you should be able to resolve the AD273 error and ensure that your data integrity is maintained.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
The AI Support Assistant is great. It provides comprehensive assistance even on the most difficult issues. I highly recommend this service.
Rate 1
John Jordan
SAP Consultant & Author