SAP NetWeaver BW has its strength in the consolidation of an enterprise’s data, serving as the single point of truth for analytical reports. The real power of BW though is generated by the analytical content contained in the system.
Starting with SAP NetWeaver BW 7.30 SP5 this wealth of analytical content is available to not only BW internal applications but also to all RESTful clients capable of accessing Open Data Protocol (OData) sources.
Based on queries flagged as Easy Query, BW exposes analytical data for lightweight consumption. Using SAP NetWeaver Gateway to access Easy Queries it is possible to expose these as OData services for mobile consumption.
Far from being SAP proprietary, OData is an open web protocol for querying and updating data. The protocol allows a consumer to query a data source over the HTTP protocol and get the result back in formats like Atom, JSON or plain XML, including pagination, ordering or filtering of the data.
The OData site odata.org provides a wealth of information on the service providers and consumers.
BW Query Designer
Once your query is marked as an Easy Query a function module is generated in the BW back-end system. The name of the generated function module can be seen via transaction EqManager.
As soon as the Easy Query function module has been generated in BW it is accessible from the Gateway system (transaction /IWFND/MAINT_SERVICE). In analogy to the Easy Query flag of BW also Gateway requires a manuel step to expose external services. To do so press the (add service) button. In the following screen enter the system alias of the connected BW system end press return. The list of non-released external services will appear.
Click on the one you’d like to expose and provide the generation package. If you do not have a specific generation package choose $TMP:
You’ll get a message on the successful creation of the service. Back in the service overview screen you can select the service and check if an OData ICF node has been generated:
If the status light is not green activate the ICF node. Now the BW query is accessible via OData! You can consume the service simply via a browser or by your mobile app. For that you’ll need the base url to the service. Press “Call Browser” to start a browser and display the base url and the xml list of all collections exposed by the service. In case of BW Queries the OData services have one Result Set Collection and depending on the query definition an additional Collection for variable values.
The base url
- the server url,
- the common sub-path /sap/opu/odata/sap/ to all OData services
- and the external service name (ZSDN_EQ in this example)
According to the OData spec one can navigate from the base url to the metadata defintion of the service and also to the contained collections. By the way: a special Gateway service exposes the full catalog of availabe services meaning that a generic OData client needs only to be connected to this catalog service to reach each and every exposed BEx query.
Mobile OData Adoption
Using the SAP NetWeaver Gateway Development Tool for Xcode you can
- easily browse through Gateway services ,
- leverage the OData SDK to create proxies for connections to Gateway services and
- easily create mobile applications for the iPhone including UI screens
Install the Xcode add-on and start developing an iPhone app. Choose the fields to display on the overview page from the OData metadata. All key figures appear twice in the list: once with (formatted value) and once without (plain floating point number) the suffix _F. In a list-based example like the one shown here it makes sense to use the formatted values. If you’d like to create a grafical display though you should use the unformatted key figure values.
Start the iPhone App simulator and provide your Gateway logon credentials…
You’ll see the list of Cost Centers and the over all totals…
If you select one cost center the detailed page is opened containing the additional information on Plan and the absolute and relative deviations between planned and actual sales figures…