0

I am developing a fullstack ABAP OData and SAPUI5 application. I have some issues with connect two entities in the request. I have a table called "Flight" and a table called "Airport". In the "Flight" table I have a primary key and two foreign keys. The foreign keys are the "DepartureAirportId" and the "ArrivalAirportId".

I created an oData-Service using the transaction SEGW. I have already created an association in ABAP, with the principal entity of Flight and the child entity for Airport.

When I called this association I've got back all of the airports which are stored in the database, but I've just wanted two of them, the departure and the arrival airports.

How can I recreate my association to get only those two airports which are given by the id?

Philipp
  • 67,764
  • 9
  • 118
  • 153
dave25
  • 121
  • 1
  • 5

2 Answers2

0

In your Get Entity Set for Airports read key from IT_KEY_TAB. Here you will primary key of flight. Through which you fetch foregn keys fro arrival and departure airports and select airports details using hte airport id's and return them in et_entityset.

Piyush aggarwal
  • 750
  • 2
  • 14
  • 25
0

You can create two entity named DepartureAirport and ArrivalAirport, and create an association with the Flight entity. This way, you can obtain a deep structure in the rows containing flight information, with separate information about two different airports.I'm sure there are better ideas, but you can achieve it with this method.