2019 Feb 25 2:42 PM
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
2019 Feb 26 12:27 AM
its just a simple CASE statement...i dont understand what is your issue...
2019 Feb 26 3:35 AM
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.
2019 Feb 26 3:35 AM
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.
2019 Feb 26 6:15 AM
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.
2019 Feb 27 2:07 AM
Agree with you. I just want to have a different view on how maintainable it is to achieve the same with CDS. Thanks!
2019 Mar 01 6:01 PM
"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.