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 relations not maintained on DB

juergen_ette
Product and Topic Expert
Product and Topic Expert
0 Likes
1,161

Hi,

what about foreign key relation between PARENT_KEY field in a subnode DB table to the DB_KEY field in the DB table of the superior node?

As far as I see such relations are not maintained in the DDIC meta data.

Such relations would be quite helpful to get the persisted DB data model complete and to simplfy the creation of corresponding CDS views.

As far as I understood the DB tables are generated by BOPF design time. Is this simply missing functionality in the DB design time or is there any misunderstanding from my side?

Would it be problematic to maintain such relations manually in SE11 after generation?

Regards, Jürgen

Hi,

what about foreign key relation between PARENT_KEY field in a subnode DB table to the DB_KEY field in the DB table of the superior node?

As far as I see such relations are not maintained in the DDIC meta data.

Such relations would be quite helpful to get the persisted DB data model complete and to simplfy the creation of corresponding CDS views.

As far as I understood the DB tables are generated by BOPF design time. Is this simply missing functionality in the DB design time or is there any misunderstanding from my side?

Would it be problematic to maintain such relations manually in SE11 after generation?

Regards, Jürgen

3 REPLIES 3
Read only

former_member190794
Active Participant
0 Likes
878

Hello Jürgen,


BOPF's association definition is built on top of DDIC, thus there is no need for BOPF to have the information stored in the database table's metadata. Of course you could add those information manually on DB level if you would like.

You didn't mentioned your use case in detail, but I guess you would like to automatically generate CDS out of BOPF. In that case you could also use the BOPF configuration in order to get the knowledge about the existence of foreign key association in BOPF instead of evaluating the database metadata:

" get all associations of a BO (including foreign key associations)

DATA(lo_configuration) = /bobf/cl_frw_factory=>get_configuration( iv_bo_key = IF_YOUR_CONSTANT_INTERFACE=>sc_bo_key ).

data(lt_association) = lo_configuration->get_assoc_tab( ).

" now check the kind of associations (field ASSOC_CAT = SC_ASSOCCAT_FOREIGN_KEY)

Best regards

Tilmann


Read only

0 Likes
878

Hi Tilmann,

ähem, as far as I know CDS design time does not know anything about BOPF meta data but classical DDIC metadata are evaluated.

Furthermore, for me it would be simply a question of meta data completness.

Re: manual maintenance of foreign key data: would these foreign keys be respected when new fields are added by BOPF design time?

Regards, Jürgen

Read only

0 Likes
878

Hello Jürgen,

you could maintain that information manually on the table, but BOPF does not take that information into account. I agree, that it would be nice to have that information in case accessing the BOPF table via CDS at design time, but that is not available at the moment.

Best regards

Tilmann