CREATING AN ODATA SERVICE WITHIN THE BW4/HANA APPLICATION LAYER [Part II]

CREATING AN ODATA SERVICE WITHIN THE BW4/HANA APPLICATION LAYER [Part II]

Note: this is the second part of the blog. Missed the first part? Read it here.

____________________________________________________________________

From design time to runtime

Right now, we have created design-time objects.

  • Click the «generate runtime objects» button at the top to create the service.

 width=

  • BW will display the model and service definition it just created afterward

 width=

  • And will ask you to assign a package for the newly created class

 width=

  • After you click on the save icon, hopefully, everything is green and successful

 width=

The Runtime objects are now generated and the model, as well as the service, are now registered.

Adding the service

With the services registered, all that RESTs us (sorry for the pun) is to activate them.

  • Go to the activate and maintain services UI: T-code /IWFND/MAINT_SERVICE
  • And click on « add service »

 width=

  • Enter System Alias: LOCAL
  • Press « Get Services »
  • Search for the service name that we created earlier
  • When selected, press « add selected services »

 width=

 width=

  • Confirm the selection in the popup

Calling the service

Now our service is up and running. We can test the service from within BW4HANA

  • Go back to the service catalog and select the service you just added
  • Once selected, test in the SAP Gateway client by clicking on the button at the bottom of the page

 width=

  • Execute the method
  • If the status code is 200, you did everything correctly and the service is running.

 width=

Extra parameters can be added to the URI to filter the data being fetched. Documentation on using these parameters can be found here.

Blog by Bart Bryon