cancel
Showing results for 
Search instead for 
Did you mean: 

Tenant specific intial data

Rwitte
Participant
0 Kudos

Dear experts,

I would have a question about tenant specific initial data in a multi tenant SAP CAP application. Let's imagine that tenant A wants to have in a code list the values C and D. However tenant B wants to have in the same code list the values E and F.

One possible way would be ofc to upload the initial data manually to the DB. However, this is quite cumbersome.

Another possible way that I thought of would be to write a custom "InitialDataTenant service" that would pick up the respective files for the tenant and provisions the DB table

However, maybe I have overlooked something in the CAP documentation and this functionality is already provided out of the box?

Would appreciate any idea around that topic.

Best regards,

Raphael

martinfrick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi raphael.witte,

I am not sure whether I get your question right... Are these tenant specific values defined upfront by the developer (so tenants can either switch between C and D e.g. in case of a premium-plan or E and F in case of a trial plan or any other criteria?) or when exactly are these tenant-specific values being defined?

What came to my mind but I'm not sure if that would work is using a dynamic filter value as part of the HDI_DEPLOY_OPTIONS during the subscription somehow?!

"include_filter" : [ "..." ]

We have included a sample in our scenario, which dynamically allows to specify the database id to which the tenant container is being deployed. Maybe something similar could work in your case?

https://github.com/SAP-samples/btp-cf-cap-multitenant-susaas/tree/main/docu/4-expert/multiple-hana-c...

Nevertheless, maybe someone of our smart CAP colleagues has an even better idea!

Thanks

Martin

martinfrick
Product and Topic Expert
Product and Topic Expert

So sth. like the following... If that makes sense from a project structure... But I guess you will need to use hdbtabledata files in this case. During subscription you can then try to influence the deployment options by passing a respective filter (haven't tried this yet...).

Rwitte
Participant
0 Kudos

Hi martinfrick,

sorry for the late response.
To answer your question: Yes, the tenant specific values are defined upfront by the developer. So we would have some kind of static mapping like this
Tenant Values

A --> C,D
B --> E,F

Thanks for the hint with the HDI_DEPLOY_OPTIONS this sounds like a feasible approach. I think I will give it a try.
But then I think I have not missed something in the CAP documentation that such a feature is already provided out of the box.

martinfrick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi raphael.witte,

Thanks for the feedback! Do let us know if you give this approach a crack and it works out for you. We're aware that there are some limitations with supported HDI_DEPLOY_OPTIONS in the mtxs context, so it'd be real interesting to find out if the filter option is working. From what I see in the code, it should be supported... Keep us posted please!

Cheers,

Martin

Accepted Solutions (0)

Answers (0)