Skip to Content
Technical Articles
Author's profile photo Denys van Kempen

Building Extensions for SAP SuccessFactors | Hands-on Video Tutorials

LATEST UPDATE: April, 2021 =========================================

For the latest information, visit

SAP Cloud Platform Extension Factory enables business application developers to focus on creating value-added app extensions and not on the infrastructure.

The Building Extensions for SAP SuccessFactors using APIs video tutorial series from the SAP HANA Academy shows how this can be done. Step-by-step, from scratch, in the patented zero-to-hero format.

In this blog you will find the videos embedded with references and additional information.

Any good? Post a comment, share on social media, and/or give a like. Thanks!

/wp-content/uploads/2016/02/sapnwabline_885687.png

Hands-On Video Tutorials

For the video tutorial series announcement from chief partner engineer, Philip MUGGLESTONE, read his blog post

You can watch the ten video tutorials in about 90 minutes. What you learn is

  • How to discover SAP SuccessFactors APIs and give them a spin on the SAP API Business Hub
  • How to use the SAP Cloud SDK to generate the virtual data model and application framework using the API specification
  • How to make OData API calls to your SAP SuccessFactors system using destinations as environment variable for local development
  • How to the same but this time with your app deployed to the SAP Cloud Platform Cloud Foundry environment using the destination and the authentication service
  • How to pair an SAP SuccessFactors system with SAP Cloud Platform
  • How to create an Extension Factory service instance for SuccessFactors
  • How to configure Single-Sign On (SSO) for the destination connection
  • How to deploy a multi-target application (MTA) archive to the SAP Cloud Platform Cloud Foundry environment

Ready? Let’s get to work.

YouTube Playlist

To bookmark the playlist on YouTube, go to

Code Repository

Because we know your time is precious, we have included code snippets so you can easily and merrily code along. For the GitHub repository with sample code, go to

/wp-content/uploads/2016/02/sapnwabline_885687.png

1. Getting Started

In the first video, we see the end result of the our efforts: a web application hosted in the SAP Cloud Platform Cloud Foundry environment that displays on a map the location of the candidates from a SuccessFactors system using OData APIs and SSO. Also covered are documentation and prerequisites.

SAP Cloud Platform Extension Factory

The conceptual view of the Extension Factory has been presented at SAPPHIRE NOW and elsewhere as illustrated, enabling extensions for SAP’s Line-of-Business applications (some as planned innovations) with secure and managed connectivity, a central API and event registry, Enterprise Messaging, and a choice of runtimes, programming models, and development tools.

For this scenario, we will be using

  • SAP SuccessFactors and the SAP Cloud Platform (side-by-side extensions)
  • SAP Cloud Platform Extension Factory
  • SAP Cloud Platform Cloud Foundry environment (Application Runtime)
  • SAP Cloud SDK

Development Tool and Programming Model

To develop our application we will be using Microsoft Visual Studio Code as IDE but you could use any another tool that supports JavaScript code development, including the latest SAP Business Application Studio.

There is a bit of buzz lately about the SAP Cloud Application Programming model (CAP) but for this tutorial we are using an older but still perfectly valid model, MTA, for multi-target applications. This model was introduced back in 2016 with XS Advanced and Cloud Foundry. Should you just tune in and need a refresher on this topic, visit

SAP Cloud SDK and OData Client Generator

The Cloud SDK provides JavaScript (and Java) libraries, project templates (best practices), and a continuous delivery toolkit to reduce effort and build better applications on the SAP Cloud Platform. For our application we will not make extensive use of all this but demonstrate the OData Client Generator. For the documentation, visit

What you Need

Dev Box

To follow along you will need the following development tools (Linux, Mac, Windows – your choice).

To deploy applications (videos 5 and 8), we will also install

Free Trial Account

For videos 1-5, we use publicly and freely accessible environments: SAP API Business Hub and SAP Cloud Platform Trial. All you need (and probably already have) are an SAP ID and a SAP Cloud Platform Trial account. This all comes for free. If you need any guidance, go to

If you are new to the SAP Cloud Platform, you might want to browse the onboarding tutorials first

Special Authorisations

SAP SuccessFactors

To make OData API calls to a SAP SuccessFactors company (system), be it demo, test, or production, you need to have an account with the OData Export privilege and this requires access to Admin Center for configuration. We show you what needs to be done (video 4), but this may require the involvement of an administrator. If not within reach, you can continue using the sandbox.

For the SAP SuccessFactors documentation, including OData authentication and operations, see

SAP Cloud Platform Extension Factory

To use the SAP Cloud Platform Extension Factory, we need

  • SAP SuccessFactors Extensibility service entitlement
  • Registered SAP SuccessFactors company (system)

The entitlement is granted at the global account level and is not available in the trial environment. If you only have access to a Cloud Foundry subaccount, you need to have this requested.

This illustration shows the components, services, and actions of the Extension Factory for SAP SuccessFactors.

When we register a system in SAP Cloud Platform the destination is automatically created. Video 6 shows the registration in action and video 8 how create an Extensibility Service instance.

For the documentation about the Extension Factory, go to

SAP SuccessFactors Provisioning

To pair an SAP SuccessFactors company (system) also requires access to the SAP SuccessFactors Business Execution (BizX) Provisioning tool (back-end). It is not rocket science, far from it, but this requires special permissions and may require the involvement of an administrator. As mentioned, video 6 shows the registration. In video 7, we address trust configuration for single-sign on, which also involves the provisioning tool. If not within reach, you can continue with the tutorials for the concepts.

For the documentation, see

/wp-content/uploads/2016/02/sapnwabline_885687.png

2. Discover APIs using the SAP API Business Hub

In the second video, Philip shows how we can try out the SAP SuccessFactors Candidate API on the SAP API Business Hub. With the provided CURL code snippet we can repeat the exercise using Postman.

Steps

  • Try out the SAP SuccessFactors Candidate API in the SAP API Business Hub
  • Execute (and tweak) the HTTP GET API call using Postman
  • Download the API specification

Code

Filter used in the HTTP GET

zip ne null and country eq 'US'

For the sandbox and production URLs and to download the specification in EDMX format, go the API details page

Sandbox HTTP GET query using SAP API Business Hub.

Sandbox HTTP GET query using Postman.

/wp-content/uploads/2016/02/sapnwabline_885687.png

3. Build Extension App using the SAP Cloud SDK

The third video shows the magic of the SAP Cloud SDK in action.

Steps

  • Create a package.json file and install the Node.js dependencies, including the SDK Cloud Generator,
  • Generate the OData client to create the virtual data model (VDM) from the downloaded API specification.
  • Create the application (server.js) with API key to make the sandbox calls, this time from the local development environment using the Visual Studio Code debugger.

Code

  • Download the code snippets for package.json and server.js from GitHub.

Commands

npm set @sap:registry=https://npm.sap.com
npm i
npx generate-odata-client -i service-specs -o generated 
# update "servicePath": "/odata/v2"
npx generate-odata-client -i service-specs -o generated --forceOverwrite

Running the debugger in local environment

/wp-content/uploads/2016/02/sapnwabline_885687.png

4. Access Your SuccessFactors System

The next step is to switch from the sandbox environment to a real system using destinations.

Steps

  • Using the SuccessFactors Admin Center, grant the user or role permission OData API Candidate Export to the user making the API calls.
  • Create a destination as local environment variable stored as file (.env).
  • Update the server.js file to use the destination environment variable name (and not URL).
  • To run the application locally using the debugger, the configuration is modified to include the environment file.

Code

Example using a destination as environment.

destinations=[{
  "name": "sfapi", 
  "url": "https://apisalesdemo2.successfactors.eu", 
  "username": "techuser@SYSTEMxxxx", 
  "password": "******"
}]

Configuration

SAP SuccessFactors Admin Center: Manage Permissions Role > HR Admin for Employees > Permissions… > Recruiting Permissions: OData Api Candidate Export

/wp-content/uploads/2016/02/sapnwabline_885687.png

5. Deploy Application to SAP Cloud Platform (Trial)

Now that we have our local app working, it is time to deploy it to the SAP Cloud Platform. For this we need to create a destination, two service instances, update the app, and run the CF CLI push command.

Steps

  • Create a SAP Cloud Platform trial account (if applicable) and enable Cloud Foundry.
  • Create a destination using the same configuration as the local environment file.
  • Create an instance of the Authorization & Trust Management service (application plan).
  • Create an instance of the Destination service (lite plan).
  • Create a manifest file for the application referencing the services.
  • Update the server.js to parse the environment variable (and not the name).
  • Deploy the application.

Code

The manifest.yml file defines the services and destination.

applications:
- name: sfsdksrv
  random-route: true
  memory: 256M
  disk_quota: 256M
  buildpacks:
    - nodejs_buildpack
  services:
    - uaa
    - dest
  env:
    apiDest: sfapi

Commands

# API endpoint of Cloud Foundry subaccount 
cf api https://api.cf.eu10.hana.ondemand.com
# logon with SAP Cloud Platform (trial) credentials and set org and space
cf l
# list services (dest and uua)
cf s
# list applications (none)
cf a
# deploy (cd srv)
cf push
# list applications (sfsdkapp)
cf a
# debug
cf logs sfsdkapp --recent
# remove
cf d sfsdkapp -f
cf delete-orphaned-routes -f
cf ds dest -f
cf ds uaa -f

Create a destination (Cloud Foundry organisation level).

Create service instances (Cloud Foundry space level).

Alternatively, you can create the service instances using the cf CLI.

cf cs xsuaa application uaa
cf cs destination lite dest

/wp-content/uploads/2016/02/sapnwabline_885687.png

6. Extension Factory Pairing

To make OData API calls to a production system and leveraging the SAP Cloud Platform Extension Factory, we need to pair the systems and configure authentication.

Steps

  • Register the SuccessFactors system in SAP Cloud Platform at the Global Account level; this generates a token
  • Add the token using the SAP SuccessFactors Provisioning tool to pair both systems
  • Create a SAP Cloud Platform subaccount (if applicable), enable Cloud Foundry, and create a space
  • Set entitlement for the subaccount
    • Application Runtime: Memory
    • Destination: lite
    • SuccessFactors extensibility: <SYSTEM>:api-access

Configuration

SAP Cloud Platform > Systems > Register System

SAP SuccessFactors Provisioning: Extension Management Configuration > Integration Token: Add

SAP Cloud Platform: Systems

SAP Cloud Platform: Entitlements

/wp-content/uploads/2016/02/sapnwabline_885687.png

7. Configure Trust for SSO

For Single-Sign On, we configure the trust relationship between both systems.

Steps

  • Download the SAML metadata from the SuccessFactors system
  • Create a new Trust Configuration for the SAP Cloud Platform Cloud Foundry subaccount by importing the SAML metadata XML file
  • Disable the default trust provider (SAP ID Service)
  • Download the SAML metadata from the SAP Cloud Platform Cloud Foundry subaccount
  • Add the relevant URLs as service provider using the SAP SuccessFactors Provisioning tool
https://<sap_successfactors_system>/idp/samlmetadata?company=<company_id>

SAML metadata URL SAP SuccessFactors

https://<subdomain>.authentication.eu10.hana.ondemand.com/saml/metadata

SAML metadata URL SAP Cloud Platform

Documentation

Configuration

Create Trust Configuration by importing SAML metadata XML file (Cloud Foundry subaccount level).

Relevant URLs from SAP Cloud Platform SAML metadata

SAP SuccessFactors Provisioning > Service Provider Settings: Authorized SP Assertion Consumer Service Setting: Add

/wp-content/uploads/2016/02/sapnwabline_885687.png

8. Extension Factory Instance

Now that we have paired our SAP SuccessFactors system with SAP Cloud Platform and established trust, we can create an Extension Factory instance for our subaccount.

Steps

  • Create an instance of the SAP SuccessFactors Extensibility service (api-access <SYSTEM ID> plan). This will automatically create the destination to this system using the SAML configuration

Documentation

Configuration

Create service instance (Cloud Foundry space level).

/wp-content/uploads/2016/02/sapnwabline_885687.png

9. Adapt App for SSO

In the previous videos (6, 7, 8), we configured our SAP Cloud Platform Cloud Foundry subaccount to make OData API calls to the SAP SuccessFactors system using SSO. Now, we need to modify our application to use this configuration.

Watch the video for the full code review.

Steps

  • Update server.js to include user authentication checks
  • Install dependencies (and update srv package.json)
  • Add xs-security.json file
  • Create an app router with package.json and xs-app.json (defines routing) files and resources directory with index.html (basic or full version with ESRI location map)
  • Create mta.yaml file for deployment at the root level

Code

  • Download the code snippets for server.js from GitHub for step-by-step (or the complete project).

Commands

npm i --save @sap/xsenv @sap/xssec passport

/wp-content/uploads/2016/02/sapnwabline_885687.png

10. Deploy MTA to SCP

With all the configuration and development done, we are ready to deploy our MTA application to SAP Cloud Platform.

Steps

  • Install (update) the Cloud MTA Build Tool (for Windows also install make)
  • Log in to the correct environment
  • Install the MTA plug-in for Cloud Foundry
  • Deploy the application

Commands

npm install -g mbt
mbt build
# set the API endpoint and log in
cf l
# install the MTA plugin
cf install-plugin multiapps
cd mta_archives
# deploy
cf deploy sfsdkapp_0.0.1.mtar 

Configuration

The deployment has created three service instances

The deployment has created two applications (app and srv)

App populating a map with SAP SuccessFactors OData API calls.

/wp-content/uploads/2016/02/sapnwabline_885687.png

Next Steps

SAP Community

For some must-reads about the Extension Factory on the SAP Community, visit

The factory has its own topic area on the community

Make sure to visit regularly for the latest blogs and Q&A’s.

SAP Learning Journey

To go all the way with SAP SuccessFactors extensions, take the learning journey

SAP TechEd

You can still watch two lectures or access the workshops from the CAA1 Learning Journey presented at SAP TechEd 2019.

/wp-content/uploads/2016/02/sapnwabline_885687.png

Learned Something New?

Post a comment, share on social media, and/or give a like. That’s how the community works. Thanks.

If you would like to receive updates, connect with me on

Best,

Denys van Kempen

/wp-content/uploads/2016/02/sapnwabline_885687.png

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Yuvaraj S K1799
      Yuvaraj S K1799

      Hi Denys,

      Happy to see you taking great effort to bring in different information under one roof, Kudos!!

      I have few questions,

      1. Will i be able make this in neo environment?
      2. If yes, What would be your piece of advice or suggestion ?
      3. If no, What is the procedure to have an extension application in neo environment?
      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      Hi Yuvaraj,

      Thank you, good to hear you found it useful.

      How to extend SFSF applications in the Neo environment is documented here:

      Note that SAP made a strategic decision to prioritise what is now called "multi-cloud" over the Neo environment running from its own datacenters.

      Multicloud is a broader term compared to Cloud Foundry as the SAP Cloud Platform now also provides ABAP and Kyma (Kubernetes) runtimes. You can find more information in another blog on this topic

      • https://blogs.sap.com/2020/07/12/developing-applications-in-a-multicloud-environment/
      Author's profile photo Yuvaraj S K1799
      Yuvaraj S K1799

      Thank so much Denys

       

      Author's profile photo Pieter Janssens
      Pieter Janssens

      It would be useful if you could also include information on restrictions and additional use cases:

      • SF Learning
        • destinations with authentication (user/admin)
        • Not available via SAP API Business Hub.
        • Possible as external service in CAP?
      • API throttling (BizX / LMS)
      • No solution for 'embedding' an extension (like SF Site Template from Neo Portal)
      • SAP's current status for IAS for SF itself is currently 'recommended to migrate'. Therefore I would advice against using SF as IDP for extensions, but instead also use IAS for authentication in the extension.
      • No integration between SF permissions/roles and UAA permissions/roles
      Author's profile photo Nicolas Lau
      Nicolas Lau

      Hi Pieter,

      thanks for pointing out "No solution for 'embedding' an extension (like SF Site Template from Neo Portal)".

      Was searching for hours for an official information regarding this embedding functionality and CF, but coudn't find any.

      best regards
      Nico

      Author's profile photo Silas rocha
      Silas rocha

      Hi, good morning !

       

      Thanks for the awesome post!

      Can you please provide the videos ?

       

      Almost all of them are not visible.

      Author's profile photo Denys van Kempen
      Denys van Kempen
      Blog Post Author

      Videos are obsolete; hence the notice at the top of the blog post

       

      LATEST UPDATE: April, 2021 =========================================

      For the latest information, visit