cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a guidebook how to set up OData services in Sap Netweaver Gateway.

0 Kudos

I did follow the training on OData (GW100). Everything was clear and I understand the principle.

Now that I started creating services I have the following questions:

1. Should I create SOA like services which can be used in different applications, or should I create a service tailored o my application?

2. If I have a service on sales order items. An item has a material. Should I include the material description in the same service, or should I create a seperate service with the material descriptions?

3. I created a service for a BAPI that creates notification headers and items. There can be multiple items per header. As far as I can see the service only can contain flat structures. How can I create a notification header with multiple items at once?

I guess in future I will have more questions. I'm now wondering whether there is a best-practices document (or book) on the design of the services.

Regards, Paul Lauwers.

Application Engineer

IFF

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Paul,

1. Gateway isn't aimed at SOA type models, it is an ROA, hence the limited CRUD and Query operations. If you think in SOA terms you will create a mess.

The SAP approach to GW services is one service per application, otherwise 'reusable' services become bulky and over-complex, no use to anyone.

2. In theory you could have a separate material service but in practice it is best to include all of your entities in one model. Including other services has some drawbacks(see above), in general I'd only include a service if it was already available and did everything that I needed. I doubt I'd build separate services from scratch and then reference them.

3. If you have done the OData course then this should be obvious Items (an entityset) are related to an entity (a sales order of another entityset). To define the relationship you associate them and provide a navigation from the sales order which will return a feed containing the item keys.

This is how you might model the material part as well (from sales item) if you need access to more material properties than those that would be contained in the sales item (such as material key).

To get "everything at once" you would $expand the sales order in the URI, else you get the order first then navigate to the items feed and pick one of them to drill down into.

This is useful reading: General Considerations - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

Regards

Ron.

0 Kudos

Rob,

With regard to your third answer. THe Service was generated for the BAPI "BAPI_ALM"NOTIF_CREATE". This BAPI has header data to create the notification and items (table type) to create the notification items. I use the method NOTIFICATION_CREATE_ENTITY. I want to create a notification with multiple items.

How would you structure your service?

Regards, Paul Lauwers.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Paul,

I would create a servic with two entity sets NotificationSet and NotificationItemSet. The entity type that is used for NotificationSet should have a navigation property called items allowing navigation from a notification to its items. Similar to the SalesOrder and SalesOrderItem Example in GW100.

You will be able to create a notification alongside with its items by implementing the method that handels deep insert.

Best Regards,

Andre

Answers (0)