cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid hard coding in SAP cloud business rules?

06-10-2021 12:02 PM
saikumar538 Explorer
716 views 4 comments
0 Likes
SAP Managed Tags
Subscribe

I have created a business rules in cloud as below -

When I tested via api.sap.com, it works fine. However, is there a way to avoid these hard coded values so that rule maintenance can be reduced? In on-premise, we have an option to assign a SET values (created in GS01 tcode) and assign the name and call the FM to get the values dynamically. But, in cloud, I'm unable to find a solution. Can any one please suggest?

Thanks,

Sai Kumar

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

Archana
Product and Topic Expert
Product and Topic Expert
0 Likes

No that is not possible. You can have reusable rule. So you can model a decision table rule for your lookup, and then call in another decision table or text rule like COUNT (SELECT <sometable> where CITY ='New York') > 0 which evaluates to if value exists in the decision table. You cannot call any external service in business rules, besides in value help. Hope that helps.

Archana
Product and Topic Expert
Product and Topic Expert
0 Likes

You can use Value Help to dynamically set the value during design time while modelling or modifying the rule. Once the rule is modified that value is set.

saikumar538
Explorer
0 Likes

Thank you for the response. Can you please share an example/blog for such scenario?

Thanks.

saikumar538
Explorer
0 Likes

Hi Archana,

I have tried adding dynamic value help and I get values as a F4 help for the field in fixed value in auto suggestion box. But, this does not solve my initial query.

I'm looking from something like below (screen shot) - similar to what we code in ABAP (If wa_field IN lr_range). Is it possible something like this to avoid manually addition of values in the rule?

Thanks,

Sai