Skip to Content
0

view data that contains foreign keys

May 01 at 06:33 PM

23

avatar image

I am in varsity currently working on a project, however l was thrown under the bus and l have to figure out how to use SAP tools for development. Now l've been relatively successful, however I'm struggling to display the data that contains foreign keys.

So far I've gotten to the stage where l can view my metadata and the relative addresses, but l do not know how to provide the address on initialization for it to populate my views.

So the context is: l have three tables, namely consultant, project and assignments. My assignments table is dependent on two foreign keys from project and consultant namely, consultantID and projectID.

So now my question is, how do l populate the view with the data from assignments, such that l can simply extract my consultant's information as well as my project information.

Any help would be greatly appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Tatenda Mafunga May 01 at 09:25 PM
0

Hi Andre.

So l am unable to access that link (most likely due to my not being an actual client). I have however made a bit of progress and am currently stuck at one point. So the way I'm currently performing the read from my database is:

oModel.read("/Assignments?$expand=ConsultantDetails", { success: function(data) { console.log(data); which returns an array with 6 elements. My question is how do l now go about printing the data that's in those arrays, as l have tried using a $select statement which l think is incorrect to extract the data?

So in essence l am asking if l am correct in my syntax in doing this: oModel.read("/Assignments?$expand=ConsultantDetails($select=Consultant_Name, Consultant_Surname)", { success: function(data) { console.log(data); or am l wrong?

Sorry to bother you so much

Regards

Tatenda

Share
10 |10000 characters needed characters left characters exceeded
Andre Fischer
May 01 at 08:32 PM
0
Share
10 |10000 characters needed characters left characters exceeded