Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_Wroblewski
Developer Advocate
Developer Advocate
I wanted to give a quick "unboxing" of the new application backend feature – which lets you build your own backend data models and to define functions that run in the cloud. I will start with the data modeling (aka, "Entities") part. Next week I will unbox the functions part.

[Yes, this feature has been commonly referred to as "Visual Cloud Functions", and the term does appear in the UI inside the Data tab and in the documentation but it is most visibly called "backends" and VCF seems to refer to only part of the feature, so for this blog post I'll refer to it as application backends.]

Also note there is really nice documentation for the feature.

 

Basic Benefits


Before going into what's in the box, lets ask, "What's in it for me?"

Without this feature, I needed to access a CAP service, HANA database or any external data store to get my data, and use that data store to share information among the many users. I do have on-device storage, but of course, that data was not shared.


Now I can create an application that has its own backend, like a real app, all without dealing with CAP, HANA or any other database.

 

Creating Data Entities


Creating data entities is pretty intuitive. I created the entities based on the model defined in the  AD180 virtual workshop for SAP TechEd.

  1. The SAP Build lobby, you click Create → Build an Application → Application Backend, and give your backend a name, like StoreFront.



  2. In the home page, you can click Create New and enter a name to create a new entity.



  3. And finally, click the new entity, and click Add New to add fields to the entity.


Pretty straightforward. Note the data types that are supported here, not all the types as in the UI designer.



Extended Entities


In addition to "regular" entities, you can build "extended" entities, basically views of a existing regular entity. In addition to simply getting the records of the source entity, you can:

  • Hide certain fields.

  • Create calculated fields using the standard SAP Build Apps formula editor.


So, using the data model from the workshop, I created an extended entity based on the product entity and hid the original product field (which is a list of product names), and created a new product field that contains the same data but removes duplicates.

Here's the extended entity fields, showing the hidden field and the new calculated field:


And here's the definition for the calculated field, basically a JavaScript formula:



If you click on the formula, you get the regular formula editor, without all the usual variables, but with access to the source entity data and all the functions.

 

Deploying the Backend


Every time you make a change to your backend (either entities or functions) and want it to be available to your SAP Build apps you need to deploy it.


It's all pretty simple, except that everytime you want to see/test your change – even if just to add data – you must deploy and each deployment for me took around a minute. To me that was a little annoying.

If the change doesn't cause problems, you just click on Review and Deploy, and you will see the version number.


But if you make a change that might break the front-end app – like remove a field – it will tell you.


If you decide to deploy the change, you will get a list of possible breaking changes that you made. Below, I removed a field, so if a UI was using that field it would cause a problem in that app.


Above, for example, I hide the field "product" in the extended entity, so any UI using that field would not work.

Click History to see a history of your changes.


Select one to revert back to that version. That version is now loaded but not saved, so if you want to keep that version, just save and redeploy.


 

Enabling the Backend from the UI


Enabling the backend is similar to enabling destinations.

Go to the Data tab, and click Add Integration → Cloud Functions.


You will see your backends, and you can select one.


Finally, inside, you can see the entities and functions available. You can select one, and then click Enable Data Entity.



Notice that you can select Data Entities and Cloud Functions tabs to view either of those objects.

 

Accessing the Backend from the UI


Finally, we want to access the data. This is done just like any other data source.

Add a data variable based on that data source.


Then use it as any other data variable, for example, attaching to a component's Repeat with property.

What's really nice is if a "breaking" change is made to the backend, then when I next edit an app that uses that backend, I will automatically get a notice that the backend was changed and listing the breaking changes.


 

Some Thoughts


People are already asking about additional features – e.g., Excel upload, access to the data outside of SAP Build Apps (service creation). The feature only just came out, so I assume it will rapidly evolve and improve, with composition of entities, additional data types like files, user-based roles, more SQL-like control, and basically more like a regular database.

But we have to remember that development has to add whatever features and still keep it a low-code tool, one that continues to be easy to use and designed for business users.

I think 2023 will bring a lot of cool stuff. Let's keep a look out together.




See all my daniel.wroblewski#content:blogposts and connect with me on Twitter / LinkedIn

 
28 Comments
SergioG_TX
Active Contributor

Daniel, thank you for sharing this blog. 2023 indeed is starting with a lot of great content, cool stuff and promising technologies.  your blog seems very simple and straight forward to create Entities.

Since this is not using CAP or HANA, where do the entities live? are these entities created per project? or can they be shared as part of a multi project initiative? I notice there is version control on the entities, is that controlled via a git repo or something different? can multiple developers work on the same project but different entities?

TMNielsen
Contributor
Hi daniel.wroblewski

I'm also interested in knowing the answer to the questions asked by 9958e4b6df99431a84a41b015b639ac8 and additionally I would like to ask a question that is perhaps a little off topic.

I know the main topic is how to handle data without a back-end SAP system, but I just noticed that you mention CAP services and not RAP services.

You write "Without this feature, I needed to access a CAP service, HANA database or any external data store" so my question is this:

Is it possible to consume Odata web APIs build on top of CDS views (for example with ADT for Eclipse) in "SAP Build App" to create, read, update data?

And by the way - happy new year.

Thomas Madsen Nielsen
Dan_Wroblewski
Developer Advocate
Developer Advocate
thomasmadsen.nielsen 9958e4b6df99431a84a41b015b639ac8 The backend technology I am less familiar with but I will get you an answer. I was using a CAP service but it was a publically available service. I don't know of any such limitations, except for on-premise services via cloud connector (which is expected to be enabled soon. I will get someone to answer these questions.
MarcHuber
Product and Topic Expert
Product and Topic Expert
9958e4b6df99431a84a41b015b639ac8 The SAP Build Apps Backend project creates a postgres database that runs on BTP. You can also share the backend that multiple developers can work on the same backend project. You can also reuse the backend in different frontend applications.
SergioG_TX
Active Contributor
hi thomasmadsen.nielsen any OData service should be consumable by SAP Build Apps. You just have to configure the Data tab (or Destination) with the OData service details (same applies for REST APIs)
Jay2
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi marchuber03  - Postgres database for no code database?
MustafaBensan
Active Contributor
Hi marchuber03

What is the reason for using a PostgreSQL database instead of SAP HANA Cloud?  I would have thought SAP HANA Cloud would have been the more obvious choice and also considering that the PostgreSQL on SAP BTP service has been retired.

Regards,

Mustafa.
aelghannam
Participant
0 Kudos
Hey Mustafa,

 

I am sure it is because of cost 🙂 . It is much cheaper to use the new hyperscaler postgres option than a full blown HANA in-memory DB.

 

Best Regards,

Boudy
MustafaBensan
Active Contributor
0 Kudos

I can understand that for customers Boudy, although it seems a bit contradictory for SAP not to use SAP HANA Cloud as the backend database in their own product.

Regards,

Mustafa.

shridharshetty
Explorer
0 Kudos
Hi @Huper Marc,

How this Web App and Backend App will work as connected application post deployment?

Regards

Shridhar
RichBlumberg
Product and Topic Expert
Product and Topic Expert
Hi! This blog is very helpful. It's provides step-by-step on connecting a database to a SAP Build App. I'm going to practice these steps... and look forward to see upcoming capabilities (e.g., excel upload).
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
The app will be deployed to HTML5 Applications and the VCF backend will be deployed to Postgres. Currently, there is a problem of access for when you deploy the app -- it works in preview, and you can work around by deploying your own approuter, though I'm sure soon it will fixed.
shridharshetty
Explorer
0 Kudos
Thanks for your response. What is the way to access it ? If these cannot be accessed how backend feature can be benefitted for SAP Build App?
vobu
Active Contributor
0 Kudos
is the Postgres connectivity by any chance using the cds-pg Adapter for CAP https://github.com/sapmentors/cds-pg, marchuber03 daniel.wroblewski?

Would be an awesome reuse of community-driven, Open Source technology!
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
I'm hopeful this will be fixed soon, but I don't know ... and I'm trying to get more info on how to deploy it properly.
mzieglerfisgmbh
Discoverer

Hey! Thanks for your post!

We are about to test SAP Build Apps in an internal project. Therefore we are using the SAP Build Web Apps Frontend and the Backend-Application. We decided to use the "No Code"-Backend Application to get the full experience of "Low Code No Code".

We did everything like described in your Blogpost and it worked.

Unfortunately, when hitting "Browse data" menu item we very very often get an error "Failed to reload data". No error message in development tools console.

There is just the message shown. When hitting the "Retry" button nothing works.

Sometimes it works and we can see the entries we created for the entity. But more often it doesn't work at all...

Is anybody of you facing the same issue? Do you have an idea how to solve that?

We also tried calling it in private mode of the browser, so that we have no Cookies and Cache to exclude the browser as an issue. It seems like a very big, not explainable bug in the application.

Thanks for your help in advance.

beapasch
Product and Topic Expert
Product and Topic Expert
0 Kudos
mzieglerfisgmbh can you please create a support ticket on component CA-LCA-ACP so that we can check the issue more in detail on your SAP BTP subaccount?

https://launchpad.support.sap.com/
Please note: Starting April 22, 2023, the SAP ONE Support Launchpad will redirect to SAP for Me, your future single-entry point for support. Get familiar already today and find more information in My Support.

Thanks and regards,
Bea Pasch
Product Management SAP Build Apps
mzieglerfisgmbh
Discoverer
beatrice.pasch thanks for your fast reply! Since I'm not alone with this is issue in my company one of my colleagues already did that the sime time i was writing the comment here.

We will wait for reply to our support ticket. Thank you!
saisrujana
Discoverer
0 Kudos
Hello All,

I am not able to deploy the Entities & functions in Build Apps App-code backend. Neither the changes are saved and deployed nor I am receiving any error. What could be the reason.

Thank you!

 
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
I tested in trial and all went OK, so I don't know a reason.

  • Does it show that it deployed?

  • Where do you see it is not deployed?

  • What exactly does it say/do when you click Review and Deploy?

saisrujana
Discoverer
0 Kudos
Hi Daniel,

Thank you for your quick response.

It's not trail account.

  • It says 'not deployed' even after clicking review and deploy.

  • I am not seeing any message or pop-up after clicking the button. Screen says still without any response.

  • I see the error 404-not found while inspecting.


Best Regards!
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
But when you click does it start to change status going from red to yellow to green, as if it’s deploying?
saisrujana
Discoverer
0 Kudos
No Daniel, it stays in Red 'Not Deployed'. Once I close the Backend application, Changes will not be available. So, my entities or functions are not even getting saved with 'Save App' button.
In History, I always see Unsaved changes (with Discard changes button)

Thanks!

 
JACoetzee
Explorer
0 Kudos

Hi, @Dan_Wroblewski , 

I have worked through a number of your blogs and they are really insightful! 

I also ran into an issue, I think similar to @mzieglerfisgmbh. I can create and deploy entities, but I cannot add any data in there. When inspecting, I can see the network call gets a 401 Unauthorized. When I try to write data from a Build App frontend, I also get a 401 error. 

I have setup my SAP BTP Destinations, added roles and myself as a user, using my email. But I cannot understand why I would be getting a 401 error. 

Any advice would be appreciated!

v_blum2000
Explorer
0 Kudos

Hi @Dan_Wroblewski

is it possible to use this backend function in SAP build process automation? I tried to use it with actions, but it didn't worked.

For example I want to use it to change data in the backend after a task has been approved or rejected.

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

There is a roadmap item for Q4 to allow access to VCF data via API and via other SAP Build products: https://roadmaps.sap.com/board?PRODUCT=73554900100800004334&range=CURRENT-LAST#Q1%202024;INNO=6DB32B...

ReenaWadhwa
Advisor
Advisor
0 Kudos

Hello Daniel,

Thanks for posting such amazing blogs . I have learnt a lot from all of them.

Can you help me in understanding if it is possible to define relationships between entities in Build Apps. I donot see a direct way to do it when defining the entity. Should it be done using cloud functions on top of it or is there any other way. E.g if i have order and product table. I donot want to create a order for a product which does not exist in product table.

Regards,

Reena 

 

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

@ReenaWadhwa Yes and no, mostly no. 

There is no way to create relationships or validation rules. I don't think you could do it with a function, since there are no conditions along the main logic flow line. I mean, you could create the record, and then add delete record whose ID would be set by formula and end up either the ID you just created or blank, but this is very clunky and not sure it would work since your function would now have a potential runtime error.

Perhaps a better way would be to retrieve the product, and then add create record and and set one of the fields (e.g., ID) so it would create an error when you failed to retrieve a product. Still clunky but better. Let me know if you have a better idea.