SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Creating an OData Service with an Entity Relationship

Creating an OData Service with an Entity Relationship

Overview

🎓 intermediate 15 min. SAP HANAIntermediateOdataExpress Edition
Thomas Jung T Thomas Jung November 1, 2022
Created by September 6, 2016
Contributors

Prerequisites

Prerequisites

  • This tutorial is designed for SAP HANA on premise and SAP HANA, express edition. It is not designed for SAP HANA Cloud.
  • Proficiency: Intermediate
  • Tutorials: Create a Simple OData Service

Steps

Step 1 Create new OData service
โ€”

Create an OData service called purchaseOrders.xsodata

Text
service {
	"PO.Header"
	as "POHeader" navigates ("Items" as "POItem");

	"PO.Item"
	as "POItem";

	association "Items"
	principal "POHeader"("PURCHASEORDERID")
	multiplicity "1"
	dependent "POItem"("HEADER.PURCHASEORDERID")
	multiplicity "*";
}

And looks like this:

Association OData
Association OData

And if you see the error marker, you can safely ignore it. It is unfortunately a false error.

Step 2 Save, run, and test
+
Step 3 Expand the child elements
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Create new OData service 2. Save, run, and test 3. Expand the child elements

Learn more →