Some new features in SAP NW Gateway 2.0 SP08
Updated on February 5, 2014 with the section about "Changesets in Multiple Origin Composition"
Here are some new and helpful features in SAP NW Gateway 2.0 SP08. Please see SAP Note 1942072 - SAP NetWeaver Gateway 2.0 Support Package Stack for the different support package levels in other SAP NetWeaver releases.
You can request the performance statistics from the SAP NetWeaver Gateway framework for each Odata request without activating the Performance Trace tool. To do this, you have to add the URL parameter “?sap-statistics=true” at the end of your URL independent of whether it is an HTTP method GET, POST, PUT, MERGE, PATCH or DELETE.
The SAP NetWeaver Gateway framework will provide the performance statistics to the consumer in the HTTP response header in following format:
HTTP Header Name: sapgw-statistics
HTTP Header Value: gwtotal=152,gwhub=106,gwrfcoh=10,gwbe=30,gwapp=6
gwtotal Total processing time of the current OData request
gwhub Processing time in SAP NetWeaver Gateway hub system
gwrfcoh RFC and network overhead for the communication between the hub and the backend system
gwbe Processing time in SAP NetWeaver Gateway framework in backend system (without application time)
gwapp Processing time in application (Data Provider)
Due to SAP security policy, the SAP NetWeaver Gateway framework only provides the performance statistics if the request processing was successful.
Data Explorer in Gateway Client (transaction /IWFND/GW_CLIENT)
The Gateway Client as a tool for testing different OData services can now display the XML or JSON response payload in a user-friendly table form.
Click on “Data Explorer” to display the response payload in table form.
Using this table form you can double-click on a link to set a new request URI for the next OData request or you can click on “ABAP Convert” and specify an ABAP structure or table to convert the data in string format into the right format. This is necessary because in case of separate hub and backend system the ABAP structure or table used in the Data Provider class doesn’t mostly exist in the hub system. Moreover, the OData format for time (e.g. PT10H02M27S) is not the ABAP one (10:02:27) or the timestamp in JSON format (e.g. /Date(1390867200000)/) is not the normal one (20140128).
Data Explorer in Payload Trace (transaction /IWFND/TRACES)
The Payload Trace is a tool for checking data sending and receiving data between an OData consumer and the SAP NetWeaver Gateway hub system. This data is in XML or JSON format and can now be displayed in a user-friendly table form.
Specific SAP Note in Error Log (transaction /IWFND/ERROR_LOG)
When raising an exception a data provider can define an SAP Note explaining the error situation and give some recommendations. The SAP Note number is also returned to the OData consumer together with other error information. The Error Log is extended to save and display this information. A double-click on the SAP Note will start your default internet browser and display the SAP Note directly.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
textid = /iwbep/cx_mgw_busi_exception=>resource_error
sap_note_id = '5'. "Application specific SAP Note ID
Performance Improvement: $batch Parallelization
The performance optimizations for $batch processing described here are only available for a hub system NW release 7.0x or 7.3x SP08 or NW release 7.4x SP06 and backend system NW release 7.0x or 7.3x SP08 or NW release 7.4x SP06.
In older support package stacks, the SAP NetWeaver Gateway framework issues one separate Remote Function Call (RFC) for each retrieve operation or each change set.
In the newer support package stacks described above only one RFC is used to send all operations contained in a batch request to the backend system (batch at once). Due to the till now implementation of the etag handling in the REST/OData library and gateway framework, all modifying operations using etag in a batch request are delivered separately to the backend system. Based on the configuration settings in the backend system (via IMG, transaction SPRO see below), all consecutive retrieve operations are parallelized to improve the processing performance. The parallelization is active per default.
The processing performance increases with more number of consecutive retrieve operations in a $batch request.
The following performance trace summary shows the performance statistics and also illustrates how a $batch request is processed in the backend system.
The $batch example contains
- 3 consecutive retrieve operations
- 1 changeset with create, update and execute action
- 2 consecutive retrieve operations
- 1 changeset with delete
- 1 single retrieve operation
From within a backend system you can use the SAP project reference object (transaction SPRO) to activate or deactivate the parallelization as follows:
SPRO -> SAP Reference IMG -> SAP NetWeaver -> Gateway Service Enablement -> Backend OData Channel -> Configuration Settings -> Define Parallelization of Batch Queries.
Changesets in Multiple Origin Composition
Changeset is a collection of one or more modifying operations having the feature "all or nothing" when processing (same meaning as Logical-Unit-of-Work in an ABAP system).
Multiple Origin Composition (MOC) is the ability to collect data from different backend systems, aggregate them in one single service and updating different backend systems while using the same user. Thus a service can be made available for several system aliases.
In the context of multiple origin composition, not only retrieve operations such as read entity, read entityset but now also changesets are supported. All operations of a changeset must be defined for one and the same system alias (SAP__Origin=<xx...x>). They are collected and sent to the backend defined by the system alias and via one RFC. You can find an example in SAP Note 1890049.
A changeset containing operations for different system aliases will be terminated with error text "Changeset containing different system aliases not supported".