Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Determination based on Multiple values of the same field

huibin_lau
Participant
0 Kudos

Hello Experts,

I have a scenario where I have to determine the price based on the services assigned to a user.

Let's say I have different services assigned to a user as below in user assignment table

user | service|

1 | service 1

1 | service 2

2 | service 3

2 | service 4

The determination rule should be changeable and should be retrieved at run time. let's say the price determination should look like this:

1. if user has service 1 and 2 assigned, price = 100

2. if user has service 2 and 3 assigned, price = 200

3. if user has service 1,2,3 assigned, price = 300

4. if user has service 3 and service 4 assigned, price = 400

in this case the price that user 1 should pay is 100.

can this be achieve with CDS view or BRF+ is a better option?

Thank you!

Regards,

Hui Bin

6 REPLIES 6

DoanManhQuynh
Active Contributor

its just a simple CASE statement...i dont understand what is your issue...

huibin_lau
Participant
0 Kudos

Hello Quynh Doan Manh,

Sorry I did not make my question clear. My question is more on how to keep the determination rules maintainable so that it can be retrieved and used for determination at runtime. The determination rules have to consider different combinations and scalability is a consideration as well.

huibin_lau
Participant
0 Kudos

Hello Quynh Doan Manh,

Sorry I did not make my question clear. My question is more on how to keep the determination rules maintainable so that it can be retrieved and used for determination at runtime. The determination rules have to consider different combinations and scalability is a consideration as well.

DoanManhQuynh
Active Contributor
0 Kudos

From my view, its better to control it through framework like BRF+ or SD Pricing conditions (if related) than through CDS View. if there is any change, you only need to input new data but with CDS you have to re-develop the view.

huibin_lau
Participant
0 Kudos

Agree with you. I just want to have a different view on how maintainable it is to achieve the same with CDS. Thanks!

Jelena
Active Contributor
0 Kudos

"determine the price" - where exactly? To find the best tool you need to know what exactly is the use case.

CDS is clearly not the right tool for this as there is business logic involved (that's what BRF+ is for) and it's likely to change.

However, based on what this is for exactly, there might be other tools that don't involve either CDS or BRF. Please be more specific when asking questions.