0

If I want to access multiple OData services on one system, how can I configure the URL of the destination? For example, there are two OData services I want to access on the same system(see below), should I just enter the host https://myxyz.ondemand.com in the URL of the destination? https://myxyz.ondemand.com/sap/opu/odata/SAP/APS_IAM_SIAG_BROLE_SRV /Aps_Iam_Siag_Br_Dll?$format=json&sap-client=100

https://myxyz.ondemand.com/sap/opu/odata/SAP/APS_IAM_SIAG_USER_SRV/UserSet?sap-client=100

Fred Z
  • 29
  • 3

1 Answers1

0

The destination service on SAP Cloudplatform offers the possibility to create multiple destinations. Thus, you can create one destination for each of your systems. See: https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/e4f1d97cbb571014a247d10f9f9a685d.html

Also locally you can provide multiple destinations over the environment variable.

Furthermore, each destination has a unique name which you have to provide. The default one for applications built with the SAP S/4HANA Cloud SDK is ErpQueryEndpoint. However, you can also use a custom name.

When using the VDM provided by the SAP S/4HANA Cloud SDK you can select which destination to use by providing a ErpConfigContext with a custom destination name to the execute method:

final List<BusinessPartner> businessPartners = service
  .getAllBusinessPartner()
  ...
  .execute(new ErpConfigContext("MyCustomDestination"));
  • Does it mean I have to configure multiple destination for the same system? During my PoC, for the first Odata service, I just created one destination with host URL. Somehow S4SDK is able to pick this OData service service. – Fred Z Mar 25 '19 at 14:41
  • If you want to talk to two different ERPs (my304X, my307X) with different hosts you have to create two dentinations for the same application. – Daniel Kurzynski Mar 25 '19 at 15:23
  • Sorry. Actually the two OData services are for the same system. In this case how do I configure the destination for the two OData services. Is the host URL enough for two different Odata services? – Fred Z Mar 25 '19 at 16:25
  • Okay. Then it is enough to define one destination. The destination should not point to the OData service but to the system, e.g. `https://myxyz-api.s4hana.ondemand.com`. The virtual data model will append the service specific url. In case of the example above it will append the path to the business partner service. – Daniel Kurzynski Mar 25 '19 at 16:51
  • If Daniel's answer solved the issue, please mark it as 'accepted' to signal other users on StackOverflow that this question is answered. You can do so by clicking the green checkmark next to the question. Thank you. – Florian Wilhelm Apr 01 '19 at 10:44