Skip to Content

SAP HANA Native, Create a SAP Cloud Application Programming Model project

Use the wizard for the SAP Cloud Application Programming Model to create a project for SAP HANA.
You will learn
  • How to create an application with the wizard for the Cloud Application Programming model
  • How to use the local Git repository for development/testing purposes
jung-thomasThomas JungJanuary 27, 2021
Created by
Lsubatin
July 25, 2019
Contributors
jung-thomas
Lsubatin

Prerequisites

  • This tutorial is designed for SAP HANA on premise and SAP HANA, express edition. It is not designed for SAP HANA Cloud.
  • You have logged into SAP Web IDE for SAP HANA. To find out more about SAP Web IDE and other tools in you SAP HANA, express edition instance, refer to this tutorial. To learn more about SAP Web IDE Full-stack for HANA development refer to this tutorial.
  • If you are planning on continuing the series in SAP HANA, express edition, it is recommended to map the development space to the tenant database before starting development.

The images in this tutorial are based on SAP HANA, express edition SPS04.

  • Step 1

    Log into SAP Web IDE.

    The default URL for SAP Web IDE in SAP HANA, express edition is https://hxehost:53075. The default user is XSA_DEV

    Right-click on Workspace and select New-> Project from Template

    New CAP model project

    Choose SAP Cloud Platform Business Application and click Next. (You may have to change the environment option in the wizard to Cloud Foundry if you are using the SAP Web IDE Full-stack)

    New CAP model project

    Use the following name for your project and click Next

    Name
    Copy
    MyHANAApp
    

    This name will be used in different steps. It is recommended that you do not change it unless you remember to replace it in future tasks.

    New CAP model project

    Choose Node.js as the service module and click Finish

    New CAP model project
  • Step 2

    The wizard has generated a Multi-target Application with two modules: a database module and a service module. Expand them to familiarize yourself with the basic folder structure.

    New CAP model project

    The wizard has also populated the mta.yaml configuration file with the necessary dependencies and parameters for each module. Open it in the code editor to explore it.

    New CAP model project

    This file is the deployment descriptor and it is the glue that keeps all the micro-services together as a single application throughout its lifecycle. It declares the modules (applications or micro-services) and their dependencies with other micro-services or backing services. You can also use this file to inject variables into the environment variable VCAP_SERVICES of your application.

    This file is very sensitive to indentation and does not allow for tabs.

  • Step 3

    You will use the local Git repository for basic version management.

    Right-click on the project and choose Git -> Initialize Local Repository.

    Initialize Git

    You will be asked for an email address and user ID for a remote GitHub server. You can enter bogus values if you do not have an account in a remote GitHub repository.

    Initialize Git

    After a few seconds, you will see a success message in the top-right corner. Use the Git icon next to it to open the Git pane.

    Initialize Git
  • Step 4

    Each time you commit to the local or remote repository, you create a version. This will allow you to revert and compare any changes.
    It is recommended that you perform commits at the end of each tutorial.

    Add a commit message and click Commit:

    Initialize Git

    It is recommended to set a remote repository in, for example, GitHub. This will allow you to have a copy of your code outside your SAP HANA instance.

    Click the console icon and look at the messages to complete the validation below.

    What does the last message say?

Back to top