Skip to Content
Author's profile photo Former Member

Visualize SAP Gateway OData services

SAP NetWeaver Gateway OData services can contain a comprehensive set of entity types and associations. A visual representation can help you understand and communicate the contents of a SAP Gateway OData service.

In this post I will describe how you can explore SAP Gateway OData services, using the Open Data Protocol Visualizer, a free extension for Visual Studio 2010.

Installing the OData Protocol Visualizer in VS2010

The Open Data Protocol Visualizer is a Visual Studio 2010 extension, which you can install via the Extension manager.

Launch the “Extension Manager” from the Visual Studio “Tools” menu.

image

The visualizer is available from the online gallery, in the Tools>Data section:

SNAGHTML30ffac2.

Click to download and install. Restart Visual Studio and you’re done!

Configure a SAP Gateway service

Let’s use the ubiquitous Flight service on the SAP Gateway demo system as an example. You will need the demo username/password, provided on this page.

The service URL for the Flight service is:

http://gw.esworkplace.sap.com/sap/opu/odata/IWBEP/RMTSAMPLEFLIGHT_2/

To use the OData visualizer, you need to create a project in VS and include a Service Reference to an OData service:

First, create (for example) a Console project. In the Service References section, right-click and select ‘”Add Service Reference”:

image

In the dialog box, enter the service Url in the Address field and provide a meaningful name in the Namespace field. Click on Go and provide the demo username and password. Visual Studio will now download the service information ($metadata). Once completed, you should now be able to expand the Service header and see the collections available through the Flight service.

SNAGHTML3273d1f

Click OK, and the Service is available for use in your project

Visualize SAP Gateway service

To start using the visualizer, right-click the Service reference and click ‘View in Diagram”

image

This opens the visualizer window. In the left pane, you will find a model browser, which lists Entity types, Associations, Complex Types and their Attributes. The center pane contains a  ‘canvas’ where you select and layout the visual representation of the model.

SNAGHTML33dadcc

A detailed view of the Flight and Booking entity types:

image

The OData visualizer has several useful features:

  • layout: determine how the shapes are visually arranged
  • zoom in/out: canvas can be zoomed in and out.
  • collapsed view: just shows entity types and associations, no attributes
  • select/deselect: determine which part of the ‘model’ you want to visualize
  • view in browser: automatically open the collection for a selected Entity type. E.g. View ‘Booking’ in browser will request the BookingCollection from the Flight service.
  • export to XPS: export the content to XPS file format (unfortunately no other file format is supported…).

Here’s an example of a collapsed (partial) view of the Activity Management service (based on SAP CRM):

image

Finally, here’s an example of the properties pane showing the attribute properties of the Value attribute of a Sales Order Item.

SNAGHTML38012a7

The OData visualizer can be a valuable part of your toolbox. Give it a try!

Thanks for reading.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Does it work for complex OData objects used in parameters of function imports (OData 3.0)?

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      The OData Protocol Visualizer can deal with complex OData types (nesting etc). But at the moment it hasn't been upgraded to support full OData 3.0

      Author's profile photo Former Member
      Former Member

      Unfortunatly, this won't work for me. I see at least the following errors and warnings:

      The custom tool 'DataServiceClientGenerator' failed.  Data service client code-generation failed: Schema specified is not valid. Errors:

      (0,0) : warning 0005: Could not find schema information for the attribute 'rel'.

      (0,0) : warning 0005: Could not find schema information for the attribute 'href'.

      (0,0) : warning 0005: Could not find schema information for the attribute 'rel'.

      (0,0) : warning 0005: Could not find schema information for the attribute 'href'.

      (0,0) : error 0129: The property 'GUID' in EntityType 'MRSS_SRV.DemandHeaderStatus' is not valid. EntityKey properties that are of type 'Binary' are currently not supported.

      (0,0) : error 0129: The property 'GUID' in EntityType 'MRSS_SRV.DemandItemStatus' is not valid. EntityKey properties that are of type 'Binary' are currently not supported.

      (0,0) : error 0129: The property 'RESOURCE_KEY' in EntityType 'MRSS_SRV.ClockData' is not valid. EntityKey properties that are of type 'Binary' are currently not supported.

      (0,0) : error 0129: The property 'DEMAND_KEY' in EntityType 'MRSS_SRV.ClockData' is not valid. EntityKey properties that are of ....

      This is rather unfortunate.

      Regards,

        Wolfgang

      Author's profile photo Holger Schäfer
      Holger Schäfer

      Did you know, that this can also easily done via an eclipse plugin, that is offered by SAP?

      https://tools.hana.ondemand.com/#gateway

      called OData Modeller

      The plugin can import the metadata.xml from uri and visualize it inside eclipse.

      If your are developing SAP OpenUI5 or SAP HANA inside eclipse, you do not need an addtional tool.

      We use it also for documentation.

      Best regards

      Holger