This is a sample integration of SAP Business One or SAP Business ByDesign with SAP Leonardo. It uses SAP Leonardo APIs to extract the features vectors of a given input product image and then find out the smiliar items.
- It is coded in NodeJS
- Can be deployed anywhere and I suggest to do it in the SAP Cloud Platform.
- It is integrated with SAP Business One using the Service Layer or SAP Business ByDesign using the OData API.
- It consumes the SAP Leonardo APIs available in the SAP API Business Hub.
Clone this repository
$ git clone https://github.com/CyranoChen/spare-parts-recognition-scp
Give a name to your app on the manifest.yml
Then set the global variables configuration in [manifest] It also requires a SAP Leonardo API Key which you can retrive AFTER login into the API Hub and clicking on GET API KEY.
LEON_APIKEY: <-- YOUR OWN LEONARDO API KEY-->
LEON_IMAGEFEATUREEXTRACTION_APIURL: https://sandbox.api.sap.com/ml/imagefeatureextraction/feature-extraction
LEON_SIMILARITYSCORING_APIURL: https://sandbox.api.sap.com/ml/similarityscoring/similarity-scoring
This project depends on an instance of B1 HANA environment and set the adminstrator account for accessing the service layer.
B1_SERVICELAYER_APIURL: https://<B1 hostname>:50000/b1s/v1
B1_USERNAME: <username>
B1_PASSWORD: <password>
B1_COMPANYDB: <companydb>
This project also integrate with an instance of ByDesign and set the adminstrator account for accessing the odata api of product data.
The odata api configuration profile should be imported by custom odata services.
BYD_TENANT_HOSTNAME: https://<ByDesign Tenant>/sap/byd/odata/cust/v1
BYD_USERNAME: <username>
BYD_PASSWORD: <password>
From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry
$ cf push
or
$ cf push --random-route
–random-route will avoid name collisions with others that deploy this same app on SCP. You can also choose your own app name by changing the manifest.yml file.
Access the app from the URL route shown in the terminal
There is a sample implementation running here. Be advised that the B1 System Backend is not running 24/7
This code snippet is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.