Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

No error while inserting record in child table with no match in master table in SAP


I have two table in SAP system- master table and child table. While using an ABAP program to insert record in child table with no matching record in master table, record is entered in database without any error however when I do this manually to insert record in child table, it shows an error message.

What could be the reason?


1 Answer
SAP Expert

Note that when you perform an insertion using an ABAP program, there is no check on foreign key constraint.  Even when you define checks in data dictionary SE11 still there is no check at database level.


When you execute using an ABAP code, this checks consistency at application level and not at database level. Errors you see in SE16 shows record rejected at application level.

You need to perform validation by checking record from master table with foreign key of child table and incase sy-subrc is not initial then record shouldn’t be inserted to the child table and shows an error message.

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.