cancel
Showing results for 
Search instead for 
Did you mean: 

Expose SAP B1 Service Layer APIs via Cloud Connector

tsambruni
Explorer

Hi,

I'd really like to start experimenting and developing with SAP AppGyver using SAP Business One as backend system.

In my environment, SAP Business One 10.0 and its service layer are running on-premise.

I set up Cloud Connector in order to establish connection between SAP BTP and on-premise system, and that works.

Now, my goal is to expose SAP Business One Service Layer APIs on the web so I can connect to them via AppGyver (or similar SaaS tools) via OData sources.

But I'm stuck here, and don't get how to progress on the topic. Which are next steps to contact service layer APIs from the web?

I've read lot of docs but they mostly refer to previous SAP Cloud Platform or similar topics, but nothing referring to SAP Business One explicitly.

Thanks, any hint would be appreciated.

franciscogo
Discoverer

I would also like more information on this. I'm hopeful there is a way I can expose our Service Layer using a connector or other middleware, without having to expose port 50000. Would like to create two way interactions using simple HTTP request with Twillio, Stripe APIs, etc.

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi thomas_sambruni,

SAP Cloud Connector works for any type of on-premise service that runs via HTTP.

When you need to request an on-premise service from an application running on BTP you can do so by creating a destination marked as "on-prem". You use the virtual hostname on the destination, so your application can make such requests to B1.

Regarding the clout-to-onprem system creation on SAP Cloud Connector, you should use the non-SAP option - since B1 is not based on Netweaver ABAP Stack.

This is all outlined here:

https://blogs.sap.com/2022/04/15/how-to-overcome-cors-error-while-connecting-sap-appgyver-to-sap-bus...

It should work for S/4HANA or B1 - it doesn't really matter.

Best regards,
Ivan

tsambruni
Explorer
0 Kudos

Thanks ivan.mirisola .

I followed your hints but I'm still unable to connect to to B1SL via BTP.

Also tried following this video as it seemed a similar use case, but still can't connect to destination:
Tutorial - Testing SAP BTP Destinations

Here's config on the on-premise B1 server, running Service Layer:

And here's destination on BTP (connectivity test works fine):

And finally, test executed (as per attached video) via BAS terminal:

user: test $ curl VirtualB1SL.dest/Items
dial tcp: lookup VirtualB1SL.dest on 100.64.0.10:53: no such host

Any other way i can test connection and make it work?

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi thomas_sambruni,

Make sure your destination has the following attributes:

HTML5.DynamicDestination=true
WebIDEEnabled=true

Here is my destination for an internet service with no authentication:

URL=https\://services.odata.org
Name=Northwind
HTML5.DynamicDestination=true
WebIDEEnabled=true
ProxyType=Internet
Type=HTTP
Authentication=NoAuthentication

Probably you created the destination after you started BAS.

On such case, you can reload the Destination Service definition via the following command on a BAS Terminal.

curl http://localhost:8887/reload

After I refreshed the destinations on BAS, I was able to get data from the service like so:

Best regards,

Ivan

tsambruni
Explorer

Thank you very much ivan.mirisola. Works like a charm in BAS now.

Just an additional hint, this should be the full set of properties I added to destination in order to make it visible inside BAS Service Center/SAP Systems:

HTML5.DynamicDestination    true
WebIDEEnabled               true
WebIDEAdditionalData        full_url
WebIDEUsage                 odata_gen

Without this set of properties connection was not visible, even after refreshing.

Unfortunately BTP destinations are still not available for usage through AppGyver, even if the integration is planned for release in current Q2 2022: https://forums.appgyver.com/t/is-there-btp-destination-support/15147

Answers (0)