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?
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.