Skip to content

Deploying a Cloud Application Programming Project with VS Code vs. BAS

Deploying a CAPM Application through the SAP Business Application Studio (BAS) and VS Code is a very simple process if you follow all the steps carefully. In my previous blog, I took you through the creation of a CAPM project through VS Code and BAS. Similarly, in continuation of the series, I will talk about the deployment process and how to push the code to the repository (deploying a cloud application programming project with VS Code vs. BAS). Firstly, let’s see how you would deploy the application into the HANA database through BAS. Initially, start with the following commands in BAS:

  1. Firstly, cds add hana–> (This configures deployment for SAP HANA to use the hdbtable and hdbview formats)
  2. Secondly, cf login  —> (here, you will need to login to the cloud foundry with your credentials)
  3. Finally, cf create-service hana hdi-shared (Project name-db) —> (This, creates the service in CF)

4 ) cf services (we can now check whether the services have been created or not)

5)  cds build –production → build the application (after the successful build, the project structure gen-folder will be created)

6)  cf push -f gen/db—> (this pushes the db-folder into cloud-foundry)

7)  cf push -f gen/srv –random-route —> (this pushes the SRV-folder into cloud-foundry)

Below, is an example of an application deployed on SAP HANA Cloud;

Now, let’s look at how we can deploy the application into the HANA Database through BAS:

For example, here, we have 2 deployment options through BAS 


1)  With MTAR

When we create CAPM Project through a template, it will have all the dependency files:

 

Upon the project’s creation, you will need to follow the steps listed below;

Step 1: 

Use command ‘Mbt build’
Then it will generate the mta_archives folder like below

Upon generating the MTAR file, right-click on it and select the ‘Deploy MTA Archive’ option from the menu. Now, enter the CF details to deploy the MTAR file to the CF.

2) Without MTAR

Now, let us see how it would work without generating the MTAR
For this, you would need to use the following command in BAS;

  1. Firstly, cds add hana–> (This configures deployment for SAP HANA to use the hdbtable and hdbview formats)
  2. Secondly, cf login  —> (Need to log in the cloud Foundry)
  3. cf create-service hana hdi-shared (Project name-DB) —> (Creating the service in CF)
  4. cf services
  5. cds build –production → Build the application (after the successful build, in project structure gen-folder will be created)
  6. cf push -f gen/db —> (pushing the db-folder into cloud-foundry)
  7. cf push -f gen/srv –random-route —> (pushing the SRV-folder into cloud-foundry)

The Application would be deployed in SAP HANA Cloud in the following manner;

A)  If you needed to push code to GIT through BAS, you would need to;
1. Create the GIT repository
2. Open BAS home page click on view — > Find command

Cloud Application Programming

3) Find out the GIT clone. 

Cloud Application Programming

Then you can enter the GIT repository url and click on enter so the clone is completed.

Now, let’s create a project like cds within it.

Cloud Application Programming

Upon the project’s creation, save all files. Enter the command ‘GIT push’ to push the code out.

At this point, it should look like the example below:

Cloud Application Programming

B) Now let us take a look at how to push code to GIT through VS Code

  1. Create a repository
  2. As a result, you can then login to the GIT account via VS Code:

Upon completing the GIT account login, we follow the same steps as we did to push the code to GIT through the BAS module. 

Personally, I prefer working on BAS. In my experience, BAS is a far simpler tool. For example, its in-built libraries make it particularly user-friendly. Further, VS Code regrettably doesn’t offer this feature.

 

View our other content, here.

Follow our journey on LinkedIn, here.

Navaneetha Nalamada comes with 7 years of experience in SAP front-end development. Her strong knowledge in SAP Fiori has led her to many successful projects & learnings. At Mindset Consulting India, she heads the team as a Sr Developer. You can find Navneetha succinct about her path in the SAP ecosystem as she has a flair for learning new things at SAP. At her leisure, you can find her listening to music of sorts.

Back To Top