Skip to content

Latest commit

 

History

History
161 lines (84 loc) · 14.2 KB

File metadata and controls

161 lines (84 loc) · 14.2 KB

Build & Deploy Business Partner Validation Application into SAP BTP Subaccount

You will learn

  • How to create, configure, and bind SAP managed BTP services to the business partner validation application
  • How to build & deploy business partner validation application into your SAP BTP subaccount

Prerequisites

  • SAP Business Technology Platform Global Account & Subaccount
  • SAP Business Application Studio subscription

Create, Configure, and Bind SAP Managed BTP Services

Inside of this application, the business partner validation application need to consume S/4HANA On-Premise Business Partner OData API and subscribe to the message queue inside of the SAP Event Mesh. To do so, we need to create serveral SAP managed BTP service instances, and then bind these instances to the business partner validation application through Service Binding. In the following section, I will show you how to create certain SAP managed BTP service instances, and then bind those instances to the business partner validation application.

  1. Clone the business partner validation application code from main branch into your SAP Business Application Studio dev space.

    1

    Notes

    • app folder contains the code for business partner validation Fiori Element UI
    • db folder contains the configuration for Sqlite DB (Local Development & Testing), HANA Cloud DB (BTP Deployment). The data in csv files under the csv folder will be loading to the Sqlite DB for local deveploment and testing purpose.
    • srv folder contains the code of business partner validation application backend Java code.
    • mta.yaml file is the deployment script for deployment purpose.
  2. Open the mat.yaml file, scrow down to the line #174, change the name of this resource to the event mesh instance's name we created in this step

    2

  3. In the mta.yaml file, scrow down to the line #189, change the name of this resource to the SAP BTP Destination Service instance we created in this step

    3

  4. Go back to the SAP BTP subaccount, create the SAP Connectivity Service instance. Make sure the give the name as s4hana-connectivity for the convenience of deployment purpose. Please refer to below image when you create Connectivity Service instance.

    4

Now we have created & binded the SAP Event Mesh, Destination Service, and Connectivity Service instances for the business partner validation application successfully. Let's jump to the next section to make some configuration changes inside of the business partner validation application.

Make Configuration Changes In the Business Partner Validation Application Backend Service

Since the backend service of the business partner validation application is build on SAP Cloud Application Programming Model (Java), so that we define several configuration and property in the application.yml file. Let make some changes there to make sure the deployment could be done without any error.

  1. Open the srv/src/main/resources/application.yaml file. Change the Amazon SNS Topic ARN and Region value to the one that we created in this previous step.

  2. In the business partner validation application, the backend service subscribe to the message queue in the Event Mesh, please refer to this documentation for more details. So in the application.yaml file, we needs to change the event mesh message queue subscription property under the default and cloud spring profile.

    Please change the subscribePrefix and queue.name value in the application.yml file to the one we created in this previous step.

    1

  3. In the business partner validation application, the backend service consume S/4HANA On-Premise Business Partner OData API via Remote Services mechanism provided by the SAP Cloud Application Programming Model. Please refer to this documentation for more details.

    Please change the destination name to the one we created in the step 4 in this previous tutorial.

    2

Now we have modified the property file for the business partner validation application backend service successfully. Let's go and deploy the entire full stack application in the next section.

Deploy the Business Partner Validation App into BTP Subaccount

Prerequisites

  • Login to the BTP subaccount with yor credential by using the followin CF CLI in the Business Application Studio terminal
  • cf api your BTP subaccount api endpoint.
  • cf login with your BTP subaccount credentail (username + password)

In this section, I will show you how to build and deploy the business partner validation application to your SAP BTP subaccount.

  1. Go back to the dev space in the Business Application Studio, right click on the mat.yaml file, then select Build MTA Project in the drop down to build and package the application.

    1

    Once the build process complete, there will be a new folder, which name is mta_archives, show up under the project root path. Inside of this folder, it contains a business-partner-validation_1.0.0-SNAPSHOT.mtar file which we could use for the BTP deployment.

    2

  2. Right click on the business-partner-validation_1.0.0-SNAPSHOT.mtar file, then select Deploy MTA Archive from the dropdown manul. It will trigger the deployment process of the business partner validation project.

    3

    Once the deployment finished, in the deployment task console we could see the words as Process Finished. This means that the BTP deployment done without any issues. Cheers!

    4

Setup Fiori Launchpad For the Business Partner Validation Application

  1. Go back to the SAP BTP Subaccount, click the Instances and Subscription on the left panel, then click the Go to Application icon of the Launchpad Service subscription.

    1

  2. In the Lanuchpad Service console, Select Chaneel Manager on the lft panel, then click Update Content icon for the HTML5 Apps.

    2

  3. Select Content Manager on the left panel, then select Content Explore and click the HTMP5 Apps card.

    3

  4. Check the S/4HANA Business Partner Validation row and then click Add to My Content button

    4

    Go back to My Content page and this time you could see the S/4HANA Business Partner Validation Fiori application listing there.

    5

  5. Click on the Everyone role lists in the Items table under My Content page. Inside of Everyone Role management page, click the Edit button, assign the S/4HANA Business Partner Validation HTML5 Apps to this role, then click Save button to save the assignment.

    6

    Now everyone could see this S/4HANA Business Partner Validation Fiori application in the Fiori Launchpad. But don't worry about the security issue, this application is protected by the XSUAA service, which means that only the people whom have the certain roles could get access into this application.

  6. Go back to the My Content page, click on the +New button, and then select the Group icon in the dropdown to create a new group.

    7

    Give the group name as S/4HANA Business Partner Validation, then assign the S/4HANA Business Partner Validation HTML5 App to this group, then click Save button to save the assignment and create the group.

    8

  7. Select Site Directory form the left panel, then click + Create Site button to create a new site for the Business Partner Validation application in the Fiori Launchpad

    9

    Give the Site Name as S/4HANA Business Partner Validation in the pop up window and then click the Create button to create the site.

    10

    Once the site created, go back to the Site Directory page again. This time you could see that the new S/4HANA Business Partner Validation site has been created and showing up there. Click the Go to site icon to check if we could open the business partner validation application.

    11

Create User-Provided Variables and Bind to Business Partner Validation Backend CAP App.

In-order to publish message to the Amazon SNS topic, we need to use the Amazon IAM programmatic user's access key and secret access key's value in our CAP application in-order to authenticate and authorize to the Amazon SNS topic we created previsouly. It's not an good idea to store these long-term AWS credentails in application configuration file or hard-coded in the code since it will bring security concerns and cause potential credentials leaking issue.

Thus, we will store these sensitive credentials as an user-provided variables and bind those variables to the backend CAP application. So that those user-provided variables will be considering as system envirounment variable, and our CAP application could consume the env variables during the run time.

  1. Go back to the SAP BTP Subaccount, go into the space and click on the business-partner-validation-srv. Click on the User-Provided Variables icon on the left panel.

    1

  2. Create the User-Provided Variable IAM_USER_ACCESS_KEY by click the Add Variable button, give the value as the Amazon IAM programmatic user's Access Key ID we created in this step. Click on Save.

    2

  3. Create the User-Provided Variable IAM_USER_SECRET_ACCESS_KEY by click the Add Variable button, give the value as the Amazon IAM programmatic user's Secret Access Key we created in this step. Click on Save.

    3

  4. Create the User-Provided Variable BP_VALIDATION_UI_URL by click the Add Variable button, give the value as the Business Partner Validation UI URL. Click on Save.

    4

  5. Go back to the application overview page, click on the Restart button to re-start the backedn CAP app.

Now we have finished all the steps to build and deploy the business partner validation application on the Business Technology Platform successfully. I will see you in the next section to show you the End-to-End flow of validating business partner within the application.