Skip to content

Commit

Permalink
readme halfway ready
Browse files Browse the repository at this point in the history
  • Loading branch information
maxstreifeneder committed May 11, 2021
1 parent 3f67288 commit 4dab402
Show file tree
Hide file tree
Showing 105 changed files with 53,862 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .cdsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"auth": {
"passport": {
"strategy": "mock",
"users": {
"bp-viewer": {
"password": "123",
"ID": "bp-viewer"
},
"bp-admin": {
"password": "123",
"ID": "bp-admin",
"roles": [
"BPAdmin"
]
}
}
}
}
}
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2017
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
37 changes: 37 additions & 0 deletions .pipeline/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Project configuration
general:
pipeline: 'sap-cloud-sdk' # this line is mandatory
buildTool: 'mta' # or 'npm'

# Stages configuration
stages:
Build:
npmExecuteLint: true # true, if you want to run a lint check that verifies the syntax of your JavaScript code

Release:
cloudFoundryDeploy: true # true, if you want to deploy to Cloud Foundry. If you set this parameter to true, the CloudFoundryDeploy step is mandatory
tmsUpload: true # true if you want to upload your artifact to SAP Cloud Transport Management. If you set this parameter to true, the tmsUpload step is mandatory

# Steps configuration
steps:

npmExecuteLint:
failOnError: false # true, if you want your pipeline to fail, if the lint check reveals any errors

mtaBuild:
buildTarget: "CF"
extensions: "live.mtaext"
mtaBuildTool: "cloudMbt"

cloudFoundryDeploy: # only relevant, if you set the cloudFoundryDeploy parameter in the Release stage to true
cloudFoundry:
credentialsId: 'cf-credential'
apiEndpoint: 'https://api.cf.eu10.hana.ondemand.com' # for example, https://api.cf.eu10.hana.ondemand.com
org: 'tfe-dev'
space: 'DEV'
mtaDeployParameters: '-f --version-rule ALL'

tmsUpload: # only relevant, if you set the tmsUpload parameter in the Release stage to true
nodeName: 'QA'
credentialsId: 'tms'
customDescription: 'TMS Upload'
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,66 @@

## Description

The main intent of this scenario is to complement an existing business process in an SAP solution – currently SAP S/4HANA with additional business process steps. This involves adding major logic and/or additional data and goes beyond simple UI changes. All of this is achieved by using DevOps tools and services provided by SAP BTP.

This application showcases:

- Building applications on SAP Business Technology Platform (BTP) using [SAP Cloud Application Programming Model(CAP)](https://cap.cloud.sap/docs/)
- Consuming events from SAP S/4HANA on premise using [SAP Event Mesh](https://help.sap.com/viewer/bf82e6b26456494cbdd197057c09979f/Cloud/en-US/df532e8735eb4322b00bfc7e42f84e8d.html)
- Consuming OData APIs from SAP S/4HANA on premise using SAP Business Technology Platform Connectivity Service
- Building a frontend for the CAP application using SAP Fiori Elements
- How to use the [Continous Integration and Delivery service](https://discovery-center.cloud.sap/serviceCatalog/continuous-integration-&-delivery?region=all)
- How to use [SAP Cloud Transport Management](https://discovery-center.cloud.sap/serviceCatalog/cloud-transport-management?service_plan=standard&region=all) in conjunction with the Continous Integration and Delivery service

## Business Scenario

A business scenario is used to showcase how to build a S/4 HANA on premise extension Application on SAP BTP.

John who is an employee of Business Partner Validation Firm iCredible, which is a third-party vendor of ACME Corporation would like to get notifications whenever new Business Partners are added in the S/4HANA backend system of ACME Corporation. John would then be able to review the Business Partner details in his extension app. He would proceed to visit the Business Partner’s registered office and do some background verification. John would then proceed to update/validate the verification details into the extension app. Once the details are verified, the Business Partner gets activated in the S/4HANA system of ACME Corporation.

- Custom extension application that works independently from S/4HANA.

- Changes in S/4 communicated via events in real time to extension application.

- Vendor personnel needs access to only custom app

### Solution Diagram

![solution diagram](./documentation/images/solutiondiagramm-1.png)

The Business Partner Validation application is developed using the SAP Cloud Application programming Model (CAP) and runs on the SAP BTP, Cloud Foundry runtime. It consumes platform services like SAP Event Mesh, SAP HANA Cloud and the Connectivity service. The events occuring in S/4 HANA on premise are inserted into the SAP Event Mesh queue. The application running in Cloud Foundry is notified on events, consumes them from the queue and inserts the event data into the HANA database. The Business Partner Validation Application uses S/4 HANA OData API's to read additional Business Partner Data from the S/4 HANA system. In case of updates performed by the third-party vendor the SAP Cloud SDK is used to update the corresponding data in the S/4HANA on premise system.

## Requirements
The required systems and components are:

- SAP S/4HANA on premise system.
- SAP BTP account

Entitlements/Quota required in your SAP Business Technology Platform Account:

| Service | Plan | Number of instances |
| --------------------------------- | ----------- | ------------------- |
| Connectivity | lite | 1 |
| Destination | lite | 1 |
| HTML5 Application Repository | app-host | 1 |
| Event Mesh | default | 1 |
| Application Logging | lite | 1 |
| Authorization & Trust Management | application | 1 |
| SAP HANA Schemas & HDI Containers | hdi-shared | 1 |
| SAP HANA Cloud | | |
| Cloud Foundry runtime | | |
| Application Autoscaler (Optional) | standard | 1 |


Subscriptions required in your SAP Business Technology Platform Account:

| Subscription | Plan |
| -------------------------------------------- | ---------------- |
| SAP Business Application Studio | standard |
| Event Mesh | standard |
| Launchpad Service (Optional) | standard |
| Continuous Integration & Delivery (Optional) | default |
| Cloud Transport Management (Optional) | saas-application |

## Download and Installation

Expand Down
231 changes: 231 additions & 0 deletions app/businesspartners/annotations.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
using tfe.service.businessPartnerValidation.AdminService as service from '../../srv/catalog';

annotate service.Addresses with @(UI : {
HeaderInfo : {
TypeName : 'Address',
TypeNamePlural : 'Addresses',
Title : {
$Type : 'UI.DataField',
Value : addressId
}
},
SelectionFields : [
addressId,
streetName,
cityName,
country,
postalCode
],
LineItem : [

{
$Type : 'UI.DataField',
Value : verifications.businessPartnerId
},
{
$Type : 'UI.DataField',
Value : addressId
},

{
$Type : 'UI.DataField',
Value : streetName
},
{
$Type : 'UI.DataField',
Value : houseNumber
},
{
$Type : 'UI.DataField',
Value : postalCode
},
{
$Type : 'UI.DataField',
Value : cityName
},
{
$Type : 'UI.DataField',
Value : country
}

],
HeaderFacets : [
{
$Type : 'UI.ReferenceFacet',
ID : 'BP',
Target : '@UI.DataPoint#BP'
},
{
$Type : 'UI.ReferenceFacet',
ID : 'Status',
Target : '@UI.DataPoint#Status'
}
],
DataPoint #BP : {
Value : verifications.businessPartnerId,
Title : 'Business Partner ID'
},
DataPoint #Status : {
Value : verifications.verificationStatus_code,
Title : 'Verification Status'
}

});

annotate service.Addresses with {
addressId @(Common.Label : 'Address ID') @readonly;
businessPartnerId @(Common.Label : 'Business Partner ID') @readonly;
streetName @(Common.Label : 'Street Name');
cityName @(Common.Label : 'City Name');
country @(Common.Label : 'Country');
postalCode @(Common.Label : 'Postal Code');
houseNumber @(Common.Label : 'House Number');
}

annotate service.BusinessPartnerVerification with {
businessPartnerId @(Common.Label : 'Business Partner ID');
businessPartnerFirstName @(Common.Label : 'First Name') @readonly;
businessPartnerLastName @(Common.Label : 'Last Name') @readonly;
verificationStatus @(Common.Label : 'Verification Status');
businessPartnerIsBlocked @(Common.Label : 'Blocked?');
}

annotate service.BusinessPartnerVerification with @(UI : {
UpdateHidden : verificationStatus.updateCode,

HeaderInfo : {
TypeName : '{i18n>Verification}',
TypeNamePlural : '{i18n>Verifications}',
Title : {
$Type : 'UI.DataField',
Value : businessPartnerId
}
},
SelectionFields : [
businessPartnerId,
businessPartnerFirstName,
businessPartnerLastName,
verificationStatus_code,
businessPartnerIsBlocked
],
LineItem : [
{
$Type : 'UI.DataFieldForAction',
Action : 'tfe.service.businessPartnerValidation.AdminService.block',
Label : 'Block'
},
{
$Type : 'UI.DataFieldForAction',
Action : 'tfe.service.businessPartnerValidation.AdminService.unblock',
Label : 'Unblock'
},
{
$Type : 'UI.DataField',
Value : businessPartnerId
},
{
$Type : 'UI.DataField',
Value : businessPartnerFirstName
},
{
$Type : 'UI.DataField',
Value : businessPartnerLastName
},
{
$Type : 'UI.DataField',
Value : verificationStatus.value,
Criticality : verificationStatus.criticality
},
{
$Type : 'UI.DataField',
Value : businessPartnerIsBlocked
},
{
$Type : 'UI.DataField',
Value : modifiedAt,

},
],
HeaderFacets : [
{
$Type : 'UI.ReferenceFacet',
ID : 'HeaderBpFirstName',
Target : '@UI.DataPoint#BpFName'
},
{
$Type : 'UI.ReferenceFacet',
ID : 'HeaderBPLastName',
Target : '@UI.DataPoint#BpLName'
},
{
$Type : 'UI.ReferenceFacet',
Target : '@UI.FieldGroup#Detail'
}

],
Facets : [{
$Type : 'UI.ReferenceFacet',
Target : 'addresses/@UI.LineItem',
Label : 'Address Facet'
}, ],
DataPoint #BpFName : {
Value : businessPartnerFirstName,
Title : 'First Name'
},
DataPoint #BpLName : {
Value : businessPartnerLastName,
Title : 'Last Name'
},
PresentationVariant : {
$Type : 'UI.PresentationVariantType',
SortOrder : [{
$Type : 'Common.SortOrderType',
Property : modifiedAt,
Descending : true
}],
Visualizations : ['@UI.LineItem']
},
FieldGroup #Detail : {Data : [{
$Type : 'UI.DataField',
Value : verificationStatus_code,
Label : 'Verification Status'
}]}
});

annotate service.BusinessPartnerVerification @(Capabilities : {
Insertable : false,
Deletable : false,
Updatable : true,
});

annotate service.Addresses @(Capabilities : {
Deletable : false,
Insertable : false,
});

annotate service.BusinessPartnerVerification with {
verificationStatus @(Common : {
ValueList : {
CollectionPath : 'StatusValues',
$Type : 'Common.ValueListType',
SelectionVariantQualifier : 'code',
PresentationVariantQualifier : 'code',
Parameters : [{
$Type : 'Common.ValueListParameterInOut',
LocalDataProperty : verificationStatus_code,
ValueListProperty : 'code',
}, ]
//entity: 'StatusValues'
},
ValueListWithFixedValues
//FieldControl: #Mandatory
});
};

annotate service.StatusValues with {
code @Common : {
Text : value,
TextArrangement : #TextOnly
} @title : 'Code';
value @title : 'Verification Status';
};
Binary file not shown.
9 changes: 9 additions & 0 deletions app/businesspartners/dist/Component-dbg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sap.ui.define(['sap/fe/core/AppComponent'], function(AppComponent) {
'use strict';

return AppComponent.extend("com.sap.tfe.bp.businesspartners.Component", {
metadata: {
manifest: "json"
}
});
});
Loading

0 comments on commit 4dab402

Please sign in to comment.