cancel
Showing results for 
Search instead for 
Did you mean: 

What is association and navigation from ABAP perspective

Sumankalyan17
Participant
0 Kudos

Hi all,

I have learining Netweaver gateway but I am facing some doubts in understandin some concepts.

Could somebody please explain what is association and navigation between entitites, from an ABAP perspective.

Being an abap developer I am trying relate to an abap point of view,but I am unable to understand this one .

Any guidance would be very much appreciated.

Regards

Suman.

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Suman,

I think it is better not to compare DB Tables and OData model. Similarities are only upto an extent.

Few pointers

- Associations say that two entities are related. Example: Employee and Company. Associations do not have any direction. Navigation refers to an Association and says if you can navigate from Employee to Company or/and Company to Employee. A navigation from Employee to Company cannot be used other way.

- If there is a navigation defined from Employee to Company, when you fetch Employee entity, there will be a URI to navigate from Employee to Company. So Navigations actually represent navigations your UI might have.

- Navigations are used in URLs. But Associations are not.

Thanks

Krishna

Sumankalyan17
Participant
0 Kudos

Hi Krishna,

in one of the examples online ,we are creating sales order by triggering NGW.In it we are creating a association and navigation between the header and item entity set .

Is it mandatory to maintain it .

i understand their meaning ,but i am unable to get as to what is their usage in abap devlopment point of view or how are going to use them in coding .

Regards

Suman

kammaje_cis
Active Contributor
0 Kudos

Examples of use of Navigations:

- You want to create Header with items. Then you need navigation from header to Item

- You want to get header WITH items. Then you need a navigation for using in $expand URL.

- You want to know a manager's reportees using a URL like ....../srv_name/ManagerSet('empid')/ReporteeNavigationName

- You want to create a Reportee for a Manager. Then you post to above URL.

Answers (2)

Answers (2)

AshwinDutt
Active Contributor
0 Kudos

Hello Suman,

OData allows us to create associations between the Entity Types to show how they relate to

one another.

Once an association is defined, we can create Navigation Paths.

The purpose of a Navigation Path is to allow the user to navigate from one side of an association to the other.

For instance, if you have selected a particular airport, then the Navigation Link will allow you see for instance, all the flights departing from that airport without the user needing to construct a specific query.


This is the Use of Association & Navigation while modelling your service in GW and accordingly you need to implement your business logic in the back end by implementing respective CRUD methods.

You need not to mix Association & navigation in OData with the Back-End.

Regards,

Ashwin

sreehari_vpillai
Active Contributor
0 Kudos

Association - Its a foreign key relationship between two tables. The way to navigate from child table to parent table is navigation .