Skip to Content

Jump start the SAP SuccessFactors Extension CAP Project

First step to start developing the SAP SuccessFactors extension
You will learn
  • How to access SAP Business Application Studio
  • How to login to Cloud Foundry
  • How to create your CAP project using cds init
  • Understand the project structure
ale-biagiAlessandro BiagiJuly 5, 2022
Created by
ale-biagi
June 17, 2022
Contributors
ale-biagi

Prerequisites

  • Step 1

    You are going to start the journey by accessing the selected IDE for development (in this case, SAP Business Application Studio). To proceed with these instructions you must have first completed the prerequisites detailed in the tutorial: Prepare to Develop the SAP SuccessFactors Extension.

    Access your trial subaccount

    Figure 1 – SAP BTP trial access

    On the left-hand side expand Services and click on Instances and Subscriptions

    Figure 2 – Instances and Subscriptions

    On the right, under Subscriptions, click on the small icon next to the SAP Business Application Studio subscription to go to the application

    Figure 3 – Go to Application

    Start your previously created Dev Space by clicking on the Start Icon on the right

    Figure 4 – Start Dev Space

    After the Dev Space has started (status RUNNING), go into it by clicking on the Space Name

    Figure 5 – Go into Dev Space
  • Step 2

    Before starting the development, you need to make sure to be properly logged in to the Cloud Foundry environment on your BTP subaccount.

    From the top menu, click on View and select Find Command…

    Figure 6 – Find Command

    In the Find Command dropdown, search for CF: Login to Cloud Foundry and select it

    Figure 7 – Login to Cloud Foundry

    Confirm the Cloud Foundry endpoint, by pressing Enter

    Figure 8 – Cloud Foundry endpoint

    Enter the e-mail address you have used to create your trial account and press Enter

    Figure 9 – Enter e-mail address

    Enter the password you have used to create your trial account and press Enter

    Figure 10 – Enter password

    Select your trial organization and press Enter

    Figure 11 – Select organization

    Select your Cloud Foundry dev space and press Enter

    Figure 12 – Select Cloud Foundry space

    Click on the small notifications icon in the bottom right corner to view the login notifications to make sure the login has been successful

    Figure 13 – Confirm successful login
  • Step 3

    Now it’s time to create the CAP Project and understand it’s structure.

    From the top menu, click on Terminal and select New Terminal

    Figure 14 – New Terminal

    In the terminal window at the bottom, type cd projects and press Enter. The terminal should look like this:

    Figure 15 – Terminal at projects folder

    Now type cds init sfsf-projman and press Enter. The output should look like this:

    Figure 16 – Project initialization

    Notice that sfsf-projman is the project and application name and also the project folder name. Now, open the project as a workspace.

    From the top menu, click on File and select Open Workspace…

    Figure 17 – Open Workspace

    In the dialog, (1) select the sfsf-projman folder under projects (2) and the VS Code Workspace (*.code-workspace) from the Format dropdown, then (3) click Open

    Figure 18 – Set Workspace
  • Step 4

    SAP Business Application Studio will restart and, after a few seconds, you should see the following structure at the bottom of the left-hand side pane:

    Figure 19 – Project Structure

    You can see that, under the project folder, cds has created three folders: app, db and srv and three files: cdsrc.json, package.json and README.md. Let’s quickly understand the purpose of each one of them:

    • app – is the folder where you are going to create the HTML5 application for the UI (in your case, it’s going to be an SAP Fiori Elements HTML5 application).
    • db – is the folder into which you will create the files to define the application data model (CDS data model) and also put some initial data in CSV format to test the application (under a subfolder named data).
    • srv – is the folder where you place the files of your service definition and business logic.
    • cdsrc.json – this file is created to specify settings to be used commonly across several projects or to alternatively hold static project settings additionally to the package.json. You can find more information about the usage of this file here.
    • package.json – this file holds project specific settings following the common node.js standard.
    • README.md – is used for project documentation.
  • Step 5

    Which command line is used to create a new "empty" CAP project?

Back to top