4.0 Module 4: Core Enabling Technologies: Gateway and OData
4.1 Introduction to SAP NetWeaver Gateway: The Bridge to the Business Suite
SAP NetWeaver Gateway is the foundational technology that serves as a bridge, connecting devices, platforms, and diverse environments to the data and business logic residing within SAP software. It operates on market standards like OData and REST, simplifying access to SAP systems for developers. Its primary role is to act as a secure and controlled entry point, significantly reducing the complexity and development time required to create applications that consume SAP data, thereby making it a cornerstone of the entire SAP Fiori architecture.
4.2 Gateway Capabilities and Deployment Architectures
NetWeaver Gateway offers several key capabilities that make it ideal for modern application development. It is:
- Non-disruptive: It can be implemented on any SAP Business Suite system.
- Easy to Develop For: It allows for the creation of simple APIs without requiring deep knowledge of proprietary tools.
- Based on Open Standards: It uses REST services and OData/ATOM protocols, enabling connectivity from any programming language or development model.
- Developer-Friendly: It provides plug-ins for common Integrated Development Environments (IDEs) such as Eclipse and Visual Studio.
There are two primary architectural models for deploying NetWeaver Gateway, each with distinct strategic implications.
- Central Hub Deployment
In this SAP-recommended architecture, the UI components and the NetWeaver Gateway are installed on a dedicated front-end server, which is kept separate from the back-end server containing the business logic.
- Analysis: This model’s key advantage is the strategic isolation of the presentation layer from the business core. It provides a single point of maintenance for all UI-related issues, enables central theming and branding, and acts as a single, secure point of access to multiple back-end systems. Because there is no direct user access to the back-end, security is significantly enhanced. While this requires a separate system, the trade-off is strategically sound for a production environment due to improved security, lifecycle management, and scalability.
- Embedded Deployment
In this model, the NetWeaver Gateway components are installed on the same system as the SAP Business Suite. The front-end and back-end logic reside together.
- Analysis: The main advantage is a reduction in runtime network calls, as communication between the UI layer and the business logic is local. However, the disadvantages are significant. The system cannot act as a central hub for other back-end systems, and in a landscape with multiple Business Suite systems, Gateway would need to be configured and maintained on each one individually. Due to these limitations on scalability and manageability, this deployment model is recommended only for sandbox or isolated development environments.
4.3 Understanding the Language of Communication: OData and REST
Open Data Protocol (OData) is a set of best practices for building and consuming RESTful APIs. It standardizes common API conventions, helping developers focus on their business logic rather than worrying about the low-level details of defining request/response headers, status codes, URL conventions, and query options. It simplifies the process of creating robust and easy-to-consume web services.
Representational State Transfer (REST) is the underlying architectural style for OData. It is a lightweight, stateless, client-server architecture that uses standard HTTP methods for all four CRUD (Create/Read/Update/Delete) operations. Its key components include:
- Resources: The core concept in REST, where data and functionality are represented as resources (e.g., a specific purchase order).
- Web of resources: Resources can contain links to other related resources, enabling navigation.
- Client-server: A strict separation of concerns between the client (which handles the UI) and the server (which handles data storage).
- No Connection state: Each request from a client must contain all the information needed to be understood and processed by the server, without relying on any previous requests.
- Cacheable: Servers can specify which resources may be cached by clients or proxies to improve performance.
- Proxy Servers: Standard HTTP proxies can be used to enhance scalability and security.
4.4 The OData Service Lifecycle and Creation
The lifecycle of an OData service in the SAP environment involves several key stages: activation of the service, ongoing maintenance of the service and its data models, and periodic cache cleanup to ensure performance.
Creating a new OData service is facilitated by the SAP NetWeaver Gateway Service Builder (Transaction SEGW). The conceptual process involves several logical steps rather than just a series of T-codes:
- Project Creation: A developer begins by creating a new project, which serves as a container for all related service components.
- Data Model Definition: The core of the service is defined here. This involves creating entity types (which represent business objects like a “Product”) and entity sets (collections of entity types, like “Products”).
- Establishing Relationships: Associations are defined to create relationships between different entity types (e.g., linking a “Supplier” entity to a “Product” entity), which allows for navigation within the data model.
- Service Registration and Maintenance: Once the data model is complete, the service is registered with the Gateway system. This makes it active and available for consumption. After registration, the service can be maintained and tested directly from the Gateway hub, which exposes it as a consumable RESTful API.
From these powerful data services, we now turn our attention to the user’s primary point of interaction: the SAP Fiori Launchpad.