Skip to Content
Technical Articles
Author's profile photo Hemchander S

Exploring SAP Cloud Platform Functions – SCP CF FaaS – Functions as a Service | Serverless coding, use-cases, How-to’s with examples – Part 1

Following the recent announcements at SAP TechEd, I was delighted to know that the support for Functions (that enables serverless computing) is available as Beta in SAP cloud platform. Although FaaS (Functions as a service) has been in the existence already – AWS Lambda, Google Cloud functions etc., it’s adoption into the SAP Cloud Platform is seen as a great welcome gesture!  Not only does it add on to the arsenal of features that’s already present, it goes hand-in-hand with the microservices architecture, cloudfoundry adoption and the latest CAP model.

I am planning to cover this feature in Parts. The first part being a general intro and a quick ‘hello world’. More interesting stuff with FaaS is coming ahead. Make sure you stay tuned to this series ! 🙂

Without spending much time describing the stuff, let’s get into some action. There are 3 key things that you should note while trying this out.

  1. Create a SubAccount with “Enable Beta Features” checked.Functions is still in beta.SAP CP Trial Account is suffice
  2. In the Global Account, under the “Entitlement” section, make sure you add the quota for the corresponding subaccount.
  3. Stick to using node.js core libraries in functions. There is a memory limitation for each function (~500MB), which might be removed in the future.


By default, we have one unassigned quota.



Once the initial subaccount setup, space creation and quota allocation is done, you can navigate to the Service Marketplace. Under the Service Marketplace, you will see Functions.


You can create a instance directly from here using Create New Instance button. For now, we are not specifying any external parameters and we skip the optional fields. Provide an instance name.

In the upcoming posts, I will explain how FaaS can be created using SAP WebIDE Full Stack as well.

The service instance would be created almost instantly ! You can go to the Functions Designer dashboard by clicking on the icon under the Actions column. The Function designer lets you create

  1. Functions – The code to be executed when it is invoked by the corresponding trigger
  2. Triggers – As the name implies, a trigger is something which invokes the function and SAP CP currently offers 3 kinds of triggers.
    1. HTTP – An HTTP url through which the function can be invoked.
    2. Timer – Timer lets you schedule function using a cron pattern. For example: This pattern “0 * * * *” executes the function every hour.
    3. Event – Executes the function on an event received or published from the enterprise messaging service
  3. Secrets – It is needed to create event based triggers. Basically it contains the credentials and service instance information of the enterprise messaging service.


You can create a new function using the “Create function” command. By default, it would have a Hello World code. However, we need to attach a trigger to execute it.

Under the Triggers tab, you can create a simple HTTP trigger and select the function name to execute.

Upon successful creation, you’d have a HTTPS url which you can open in the browser.

There it is ! A simple hello world app that we never coded. It was all a bit of setup and configurations done in minutes to have this running.

However, let’s not get carried away by the simplicity. In order to know how it works, I’ve added a specific page from documentation which will be handy when you start developing further. It is detailed further in the Functions programming model over here

Let’s play around with the event parameters a bit. The guide states the following:

Let’s print the request headers.

module.exports = {
    handler: function(event, context) {
        return JSON.stringify(event.extensions.request.headers);

Here we go ! Make sure you “Save and Deploy” the code every time you make the changes.

Play around with the feature and let me know your interesting findings ! I will be covering the use-cases for FaaS in-depth in the next post. Stay tuned ! 🙂


  1. Getting Started with SAP CP Functions (Beta)
  2. Official Documentation

Let me know if you have any queries and please share your interesting findings as well! You can contact me on LinkedIn or Twitter or through any of the profiles mentioned in my site regarding the same! Until then stay tuned!

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sergio Guerrero
      Sergio Guerrero


      thank you for sharing this detailed blog. It seems like it is the first one related to FaaS... I look forward to reading more like this one. i will also try to come up w one soon.

      Author's profile photo Hemchander S
      Hemchander S
      Blog Post Author

      Hi Sergio Guerrero !

      Thanks ! 🙂 Many more use cases coming soon!


      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      any idea, why my trail account may not have functions in the service market place ? see img attached

      Author's profile photo Maximilian Streifeneder
      Maximilian Streifeneder

      Hi Sergio Guerrero

      from my point of view there are only 2 root causes:

      1. your subaccount is not beta enabled
      2. The entitlement in your global account is not maintained accordingly.

      Could you please double check them? (probably screenshots)


      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      thanks for the prompt response Maxi ...


      the account i set beta enabled on the first step as described by Hemchander. I tried on 2 diff trial accounts I have. Neither of them showed the functions section.

      what additional steps should i do on the The Entitlement sections.

      Author's profile photo Maximilian Streifeneder
      Maximilian Streifeneder

      I assume that you've missed this step:

      not sure if I understand you correctly, If you've done the entitlement step.

      When your new subaccount is created, go back to your global account, Click on "Edit" on top of the Entittlement page and set the quota for "Functions" to 1 for the recently created subaccount. After that your subaccount should show the "Functions" tile in the according Service Marketplace.

      If it still doesn't work, could you please post screenshots of:

      1) your subaccount (there should be a "Beta" right after your subaccount name in the subaccount overview of your global account)
      2) your quota allocation in the entitlement sections
      3) your service marketplace after that


      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      actually, i see the missing step:

      the entitlement needs to click on Edit ... in order to change the functions from o  to 1

      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      Maximilian Streifeneder   any ideas?

      Author's profile photo Hemchander S
      Hemchander S
      Blog Post Author

      Hi Sergio Guerrero !


      I hope you were you able to set the entitlements ? I was away for a while sorry!

      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      hi Hemchander, yes thank you very much.. your blog as well as help from others in the community i was able to find where i needed to enable it

      Author's profile photo Dinesh Ghanta
      Dinesh Ghanta

      Hi Hemchander,


      After adding the quote we need to create the new Space "test" in the new account. Then only we will be able to go to Service Market Place. Please add this for the benefit of everyone.


      Thanks and Regards

      Dinesh Ghanta

      Author's profile photo Percy Villajulca
      Percy Villajulca


      In case some, someone runs into this issue while creating the service instance:

      Service broker error: Service instance name not provided

      try this solution

      Author's profile photo Dileep Kosana
      Dileep Kosana


      I am getting below error when instance is creating.

      Service broker error: Service is deprecated.

      Author's profile photo Jasper Vanhove
      Jasper Vanhove


      I'm new to cloud functions and EM so playing around a bit. I've set up an EM with 1 topic and can push messages on it with Postman API. I've created 2 event Functions which posts a simple console.log message and linked 2 Event triggers on the topic from the EM. I also created a third Function (again showing a simple console.log msg) with a trigger linked to the queue itself. Everything works fine, i can push a message to the topic which activates all 3 functions.

      Now i have created the same exact thing on another EM queue with 2 topics (and with 4 functions) but this doesn't activate the functions. The messages are getting put onto the queue though.

      If i try to put a message onto the first queue again via the topic (so my working example from before), it doesn't work anymore (but the messages are also getting put onto the queue).

      any idea's on what could cause this??

      kind regards,

      Jasper vanhove