Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Foreign Key Table delete - RDBMS Rule

former_member194669
Active Contributor
0 Likes
1,836

Hi,

This is regarding my previous question

I am more details on this->

Parent Table fields

MANDT CLNT 3

TCTR CHAR 6

Child Table fields

MANDT CLNT 3

SPRAS LANG 1

TCTR CHAR 6

TRDESC CHAR 40

Here SPRAS has given fireign key relation to T002-SPRAS and TCTR foreign key relationship to Parent table TCTR.

If i am trying to delete entries from parent table system not deleting entries in child table

If i am using Native SQL commands then whether it will get delete?

Any info on this.

Thanks

aRs

Hi,

This is regarding my previous question

I am more details on this->

Parent Table fields

MANDT CLNT 3

TCTR CHAR 6

Child Table fields

MANDT CLNT 3

SPRAS LANG 1

TCTR CHAR 6

TRDESC CHAR 40

Here SPRAS has given fireign key relation to T002-SPRAS and TCTR foreign key relationship to Parent table TCTR.

If i am trying to delete entries from parent table system not deleting entries in child table

If i am using Native SQL commands then whether it will get delete?

Any info on this.

Thanks

aRs

6 REPLIES 6
Read only

Former Member
0 Likes
1,085

HI,

I have question for you,

How are you defining a foreign key relation in an SAP table ?

As far as I know you can only define entry help / check for the fields. This does not create a foreign key relationship. It only helps for value help and validation for entries in this field. And it does not create any relationships between the tables even in the backend database.

So when you delete entries from the (Parent) table it does not complain. Even if you use Native SQL noting is going to change becase no foreign key relationship exists.

Tell me if you find something different.

-Kalyan

Read only

former_member194669
Active Contributor
0 Likes
1,085

Kalyan,

Please go thru this link, you get info releated to foreign key table i mentioned in may question.

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea9e446011d189700000e8322d00/frameset.htm

aRs

Read only

Former Member
0 Likes
1,085

Hi,

First you have to delete that relationship from the CHILD table(delete Parent table for the field TCTR and SPRAS), then you can easily delete the entries.

Generally when your you try to delete entries fron one table, SAP checks for all dependencies such as Foreign key relationship and won't allow to delete .

regards,

Anji

Read only

former_member194669
Active Contributor
0 Likes
1,085

Hi,

If i am try to delete entries from parent table without deleting from child table first also system deleting entries from the parent table.

What i am doing wrong?

Whether SAP is not considering the RDBMS rule.

<b>

Help Please....

</b>

aRs

Read only

0 Likes
1,085

Hi,

I tried this out with a table that has foreign key relationship with a parent table .

I inserted a new record in a table which has a foreign key relation with value that the parent table does not have. it let me insert.

It look like even if you define a foreign key in the DDIC it does not create the relation in the database level. I think this is only used for checks in SAP. It does not follow the RDBMS rules.

- Kalyan

Read only

former_member194669
Active Contributor
0 Likes
1,085

Anybody have a solution for this issue.

Please help..

Thanks

aRs