Note: If you have already set up the SAP S/4HANA Cloud and SAP Sales Cloud system, you can skip this section.
Clone the mock server application from GitHub using the branch mock
:
git clone https://github.com/SAP-samples/cloud-extension-ecc-business-process -b mock
You will use the Cloud Foundry Command Line Interface (cf CLI) for the deployment. In case you have not installed it yet, follow the steps described in GitHub.
To deploy the application, perform the following steps:
-
Open command prompt.
-
Log in to the account and space:
cf login -sso
Alternatively, run this command:
cf login
- Navigate to the folder
Mock application folder
that you have cloned from the GitHub in the previous step.
If you are using SAP Business Application Studio, skip the following steps.
-
To build the multitarget application, you need to download the Cloud MTA Build Tool (MBT).
-
For Windows, install MAKE.
-
To install the MultiApps CF CLI Plugin, run the following command:
cf install-plugin multiapps
- To install the Cloud MTA Build Tool, run the following command:
npm install -g mbt
To build the application, run this command:
mbt build
To deploy the application, run this command:
cf deploy <path/to/mtar>
To receive the events in the SAP Event Mesh queue, bind the same Georel application SAP Event Mesh instance to the mock server.
Run the following command from the terminal:
cf bs mock-srv georel-graph-em && cf restart mock-srv
You need to configure two destinations for your SAP Sales Cloud system mock and the SAP S/4HANA Cloud system mock, which would be used for the SAP Graph configuration in the next steps.
-
Open the SAP BTP cockpit, go to your global account and navigate to your subaccount.
-
Choose Connectivity in the left-hand navigation, and then choose Destinations → New Destination.
-
Enter the following information for the first destination in the Destination Configuration section and save your input:
- Name:
graph-c4c-dest
- URL:
https://<mock_srv_url>/odata/v2/c4codata
- Authentication:
No Authentication
- Name:
-
Again, choose Destinations → New Destination and enter the following information for the second destination and save your input:
- Name:
bupa
- URL:
https://<mock_srv_url>/odata/v2/api-business-partner
- Authentication:
No Authentication
- Name:
- Select Graph under Design Artifacts in the left-side menu of the SAP Integration Suite interface.
- Choose Model Extensions tab and click on create from file.
- Give the name Logistics Partner and upload the file Logistics.custom.json from the config folder.
- Click on Create.
Logistics Partner model extension was created successfully and can now be used in a business data graph.
- Select Graph under Design Artifacts in the left-side menu of the SAP Integration Suite interface.
- Select Create new business data graph in the panel.
- Provide an ID for the business data Graph as
v1
. Click Next.
- Select the data sources to include in the business data graph. These are the destinations you previously configured in the SAP BTP cockpit.
- bupa
- graph-c4c-dest
- logistics-partner
Select Next
-
Choose the configured Model extension
Logistics Partner
and select Next -
Once the draft busines data gets generated, review the configuration.
-
Add the following Key mappings in the locating policy.
"keyMapping": [
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.CorporateAccountCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
},
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.IndividualCustomerCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
}
]
After adding, full configuration should look like this
{
"businessDataGraphIdentifier": "v1",
"description": "This business data graph includes APIs of SAP S/4HANA Cloud and SAP Sales Cloud",
"graphModelVersion": "^v3",
"schemaVersion": "1.2.0",
"extensions": [
"Logistics Partner"
],
"dataSources": [
{
"name": "s4",
"services": [
{
"destinationName": "bupa"
}
]
},
{
"name": "c4c",
"services": [
{
"destinationName": "graph-c4c-dest"
}
]
},
{
"name": "my.custom",
"services": [
{
"destinationName": "logistics-partner"
}
],
"namespace": "my.custom"
}
],
"locatingPolicy": {
"cues": [],
"keyMapping": [
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.CorporateAccountCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
},
{
"foreignKey": {
"attributes": [
"ExternalID"
],
"dataSource": "c4c",
"entityName": "sap.c4c.IndividualCustomerCollection"
},
"references": {
"attributes": [
"BusinessPartner"
],
"dataSource": "s4",
"entityName": "sap.s4.A_BusinessPartner"
}
}
],
"rules": [
{
"name": "sap.s4.*",
"leading": "s4",
"local": []
},
{
"name": "sap.c4c.*",
"leading": "c4c",
"local": []
},
{
"name": "sap.graph.*",
"leading": "s4",
"local": [
]
},
{
"name": "sap.graph.AppointmentActivity",
"leading": "c4c"
},
{
"name": "sap.graph.BusinessUser",
"leading": "c4c"
},
{
"name": "sap.graph.ClassificationCharacteristic",
"leading": "c4c"
},
{
"name": "sap.graph.ClassificationClass",
"leading": "c4c"
},
{
"name": "sap.graph.Company",
"leading": "c4c"
},
{
"name": "sap.graph.ContactPerson",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.CorporateAccount",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.Country",
"leading": "c4c"
},
{
"name": "sap.graph.Currency",
"leading": "c4c"
},
{
"name": "sap.graph.Customer",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.CustomerGroup",
"leading": "c4c"
},
{
"name": "sap.graph.DistributionChannel",
"leading": "c4c"
},
{
"name": "sap.graph.Division",
"leading": "c4c"
},
{
"name": "sap.graph.Equipment",
"leading": "c4c"
},
{
"name": "sap.graph.FunctionalLocation",
"leading": "c4c"
},
{
"name": "sap.graph.IncotermsClassification",
"leading": "c4c"
},
{
"name": "sap.graph.IndividualCustomer",
"leading": "c4c",
"local": [
"s4"
]
},
{
"name": "sap.graph.IndustrySector",
"leading": "c4c"
},
{
"name": "sap.graph.Job",
"leading": "c4c"
},
{
"name": "sap.graph.Language",
"leading": "c4c"
},
{
"name": "sap.graph.MeasurementDocument",
"leading": "c4c"
},
{
"name": "sap.graph.MeasurementPoint",
"leading": "c4c"
},
{
"name": "sap.graph.PersonMaritalStatus",
"leading": "c4c"
},
{
"name": "sap.graph.PersonTitle",
"leading": "c4c"
},
{
"name": "sap.graph.PhoneCallActivity",
"leading": "c4c"
},
{
"name": "sap.graph.Product",
"leading": "c4c"
},
{
"name": "sap.graph.ProductCategory",
"leading": "c4c"
},
{
"name": "sap.graph.ProductCategoryHierarchy",
"leading": "c4c"
},
{
"name": "sap.graph.ProductType",
"leading": "c4c"
},
{
"name": "sap.graph.SalesContract",
"leading": "c4c"
},
{
"name": "sap.graph.SalesDocumentCancellationReason",
"leading": "c4c"
},
{
"name": "sap.graph.SalesDocumentReason",
"leading": "c4c"
},
{
"name": "sap.graph.SalesLead",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOpportunity",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOrder",
"leading": "c4c"
},
{
"name": "sap.graph.SalesOrganization",
"leading": "c4c"
},
{
"name": "sap.graph.SalesPricingConditionType",
"leading": "c4c"
},
{
"name": "sap.graph.SalesQuote",
"leading": "c4c"
},
{
"name": "sap.graph.SalesRoute",
"leading": "c4c"
},
{
"name": "sap.graph.SalesVisit",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceDocumentPriority",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceRequest",
"leading": "c4c"
},
{
"name": "sap.graph.ServiceRequestType",
"leading": "c4c"
},
{
"name": "sap.graph.TaskActivity",
"leading": "c4c"
},
{
"name": "sap.graph.TimeSheet",
"leading": "c4c"
},
{
"name": "sap.graph.TimeZone",
"leading": "c4c"
},
{
"name": "sap.graph.WorkAssignment",
"leading": "c4c"
},
{
"name": "my.custom.*",
"leading": "my.custom"
},
{
"name": "custom.ns.Logistics",
"leading": "my.custom",
"local": []
},
{
"name": "custom.ns.Logistics",
"leading": "s4",
"local": [],
"sourceEntity": "sap.s4.A_BusinessPartner"
}
]
}
}
Click on Create.
See Configuration File in the SAP Graph documentation.
- Wait for status to update to Available.
The status goes from Processing > Offline > Available.
-
In the command line interface, run the command
cf apps
. -
Find the URL for the Geo Relations app (
geo-customer-ui
). This is the launch URL for the Geo Relations application. -
Open the URL in a browser.
-
Choose the tile for Geo Relations application.
- The list of Customer Relation Processes along with their status gets displayed.
- Create a new customer in the mock server using business partner API:
POST https://<mock_srv_url>/v2/odata/v4/api-business-partner/A_BusinessPartner
{
"BusinessPartner": "25555",
"BusinessPartnerFullName": "Max Mustermann",
"FirstName": "Max",
"LastName": "Mustermann",
"BusinessPartnerIsBlocked": true,
"Language": "EN",
"to_BusinessPartnerAddress": [
{
"BusinessPartner": "25555",
"AddressID": "1",
"StreetName": "Platz der Republik",
"HouseNumber": "1",
"PostalCode": "10557",
"CityName": "Berlin",
"Country": "DE",
"Language": "EN"
}
],
"to_Customer": {
"Customer": "25555"
}
}
-
Now, go back to the Geo Relations application to see if the new Business Partner has been updated in the UI.
-
Go to the details page for the new Business Partner. Choose Edit.
-
Add Account Team responsible for the Business Partner from the SAP Sales Cloud system.
-
Fill the Delivery Unloading point.
-
Notice that the changes reflected back to the Business Partner using the SAP S/4HANA Cloud and SAP Sales Cloud API in the mock server.
Delivery Unloading Point:
GET https://<mock_srv_url>/v2/odata/v4/api-business-partner/A_Customer('25555')/to_CustomerUnloadingPoint
Account Team:
GET https://<mock_srv_url>/v2/odata/v4/c4codata/CorporateAccountCollection('<OBJECT_ID>')/CorporateAccountTeam
Replace mock_srv_url
and OBJECT_ID
accordingly.
Hint:
OBJECT_ID
can be located in the details page asSales Cloud Object
.
-
Open
Logistics Information
section and notice the shipment details.In the next step, lets add the Delivery Partner, Expected Delievery and Shipment Status in the Logistics partner application to see whether the changes reflect in the Geo Customer relation application.
-
Open the
Logistics Partner
application that we deployed in the earlier chapter.Open the web application.
-
Find the
customerId
in the list and go to the details page. -
Edit the information and add/change the fields.
Save the changes.
-
Refresh the Geo customer relation application to see the latest updates.
-
Check out the options that the Geo Relations app offers like changing a status.
-
Play around with the application.