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

Create Foreign Key with Function module RPY_FOREIGN_KEY_INSERT

0 Likes
693

Hi,

I have to create a foreign key through an ABAP program (not through DDIC functionalities!) on a SAP NetWeaver 2004s system.

I have already found the Function module RPY_FOREIGN_KEY_INSERT but it doesn't work. It runs without any errors but the foreign key is not generated, even when call the Function module DDIF_TABL_ACTIVATE after RPY_FOREIGN_KEY_INSERT to avtivate the table again ( i also tried it with a COMMIT WORK).

Has anyone worked successfully with this Function module and can tell me how it works (e.g. how the parameters of the tables FORKEY_FIELDS and FORKEY_INF have to be set)?

Thank you very much for your help,

Jessica

4 REPLIES 4
Read only

sudhindra_chandrashekar
Product and Topic Expert
Product and Topic Expert
0 Likes
653

Hi,

The best approach to this issue is to use the function module "RPY_FOREIGN_KEY_READ". First construct the table the way you want through the DDIC tools and then test this function module and you will get a clear idea of the values you need to pass in the interface.

Hope this helps,

Sudhi

Message was edited by: Sudhi

Sudhindra Chandrashekar

Read only

0 Likes
653

Hi Sudhi,

thanks for your answer! I just created a table with a foreign key through DDIC and read the information with "RPY_FOREIGN_KEY_READ". Then I deleted the foreign key and called the function module "RPY_FOREIGN_KEY_INSERT" with the identical values which have been readout before but the foreign key was not created.

Regards, Jessica

Read only

0 Likes
653

Hi,

I tried it too but unfortunately it is not working for me either. I am not sure why! In principle and theory it should work.

The table gets activated though!

Sudhi

Read only

0 Likes
653

Hi,

>>In principle and theory it should work.<<

That's true g. But nice to hear that I am not the only one with this problem.

Jessica