Skip to Content
Technical Articles

Working with Value Help in SAP Cloud Platform Business Rules

Business rules have always been a brilliant tool to automate decisions or achieve validations or define complex regulatory or compliance rules etc. This tool has evolved over time and again with change in platforms ranging from ABAP to Cloud. With recent innovations and change in strategy, SAP Cloud Platform Business Rules is to become the central tool to author, manage and extend rules.

This means that business rules modelling in cloud has to be enhanced with best-in-class features and capabilities from all these different rules technologies – and the enhancement has to be made such that it ultimately eases the development effort of business users and application developers. One area of improvement was the need of value help while authoring rules that are (a) based on fields which have some predefined values in the backend system or (b) based on a fixed set of approved values based on organisation and department. For examples: country codes, currencies, financial document types, product ids from backend ERP or Ariba systems or list of country specific benefits from SuccessFactors etc.

As business rules are highly customizable and changeable based on organisation’s need and market trends, it is important to have such features (like value help) which ensures that business users don’t have to remember or contact the backend expert to search for these value list instead they are smartly available for them while modelling or updating the rules.

In this blog, I am going to explain you on how to work with value help in SAP Cloud Platform Business rules. To start with, here are some quick information:

  1. value help is available for the attribute in data object
  2. value help is offered in two ways (a) static and (b) dynamic.
    • Static value list is manually defined while authoring attribute
    • Dynamic value list is fetched from the backend configured system which could be any SAP, non-SAP, cloud or on-premise system. For this, the backend system must expose OData or REST-service that would be consumed by business rules to obtain the required value set.

Let’s start …

STATIC VALUE LIST

  1. To model static value help, navigate to attribute of the data object and switch to Value Help tab

 

  1. Click on Edit (on top-right corner) and click on + button to add a new row.
    Then, select the Value List option to create static value list

 

  1. Click on Value Help row. It will lead you to the screen from where you can create, save and update the key-value pairs for your value list.

Note: Once you create a value help pair, you cannot change the value(key). You can only change the description. When you want to model the rule, you will see both key-value and when you select one pair, the key gets shown and persisted.

 

  1. If the attribute has value help assigned to it, then you will see “Select from value help” option on the top while editing the rule using auto-suggestion option.

 

  1. On selecting that option, you will see static value list in the new pop-up.
    note: you can search for the value or description like AGR or Argentina based on the exact text.

 

  1. Once you select, the value (or the key) gets selected and persisted in the business rule

 

DYNAMIC VALUE LIST

  1. If you want to use dynamic value list, then you first have to create destination. This can be done from SAP Cloud Platform cockpit.

 

  1. Next, you have to configure the system in SAP Cloud Platform Business Rules. To do so, you can use Configure Systems views –> add a new system –> give any name of your choice –> give the same destination name as created above and keep context-path as empty, as shown

 

Choose this system as System property of the project

 

  1. Navigate to the attribute of the data object. Switch to Value Help tab and add a new value help with Service URL Mapping option

 

  1. Enter the information of the service URL that would be triggered to fetch the values

 

rest how you use auto-suggestion for dynamic value help is the same:

 

This feature is available in all factory accounts and trial. Try it out for and let me know if you face any issues or need any further assistance with this feature. For more information, you can read the help documentation

 

 

 

 

23 Comments
You must be Logged on to comment or reply to a post.
  • Hi Archana,

    Thank you for guiding how to use look ups in Business Rules.

    I tried setting up a static lookup but when I try to add the values in the decision table, I am able to enter the values which are not a part of the lookup. Would the lookup not restrict the user to pickup the value from the value help created?

     

    Regards,
    Sruti

    • Yes, Value help association to data-object attribute does not mean that you can use only value help. You can choose the values via value-help or enter static value or also a dynamic value.

       

  • Hi Archana,

    I tried creating a Dynamic Value Help following your blog and the SAP help documentation.

    The value help does not work for me and when I debug more I see the below error.

    I have ensured that the destination is configured correctly and I do not use the managed system name in the URL while defining the value help.

    It would be great if you could point if I am missing something.

    <?xml version=“1.0” ?><error xmlns=“http://schemas.microsoft.com/ado/2007/08/dataservices/metadata“><code></code><message xml:lang=“en”>counting the entity was unsuccessful</message></error>
    –batch_791b7320-71a3-4723-938e-2332b84808cb
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    HTTP/1.1 400 Bad Request
    DataServiceVersion: 1.0
    Content-Type: application/json
    Content-Length: 127

    {“error”:{“code”:“bpm.rulesrepo.enum.invalidexternalvalue”,“message”:{“lang”:“en”,“value”:“Managed System is not configured”}}}
    –batch_791b7320-71a3-4723-938e-2332b84808cb–

     

    Can you also tell if I make a column as Dynamic Value help, can I enter values which are not a part of the value help?

     

    Regards,

    Sruti

  • Hello Sruti,
    Ofcourse you can use any other value even if you have configured for Dynamic Value.
    From the error message, it shows that you have not configured the system via Configure Systems (step 8 in my blog) – can you confirm if you have done that. Please raise the issue in LOD-BPM-RUL if the issue still persists after you have ensured that you have diligently followed my blog!

  • Hi Archana,

    Thank you for your response.

    Is forcing the user to pick the value from the Value Help on the road map? We have a business requirement where the user should enter a value which is valid.

    We have created/configured the system as described in the blog but it is not working. We will raise a ticket for the same.

    Regards,
    Sruti

  • Hi Archana,

     

    I am facing the same issue as reported in the previous comment. I followed all the steps as per the blog.

    1. created a http destination in SCP which connects to HANA DB (the data for the dynamic help comes from a .xsodata )
    2. created a managed system in Business rules and configured the destination in it.

    3. maintained service url mapping in the dataobject

    4. tried to get the value help in the rules but the value help came up empty and the console had the error below.

     

    You can see that the xsodata gives the data without any issues when tested.

     

    not sure what I am missing/overlooking. Can you please help? We are working on a POC and this is really required.

    thanks, Sharadha

  • Hi Archana Shukla. Any new on this topic / error? I am facing the same issue. Another thing is that you can configure multiple systems, but how do you point to a specific system on the value help setup? Here you only point to the entity?

    Regards Morten

    • Hello Morten,

      You cannot configure multiple systems for value help now. It’s in roadmap. If you can send me the error and type of URL you calling that would help me in figuring out the issue. The issue above comes when you have not configured you Manage Systems and used in the project (step 8 of my blog)

  • Hi Archana Shukla ,

    I have followed the blog and am facing the below issue : This was reported earlier as well

     

    HTTP/1.1 500 Internal Server Error
    DataServiceVersion: 1.0
    Content-Type: application/xml
    Content-Length: 190

    <?xml version=”1.0″ ?><error xmlns=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata”><code></code><message xml:lang=”en”>counting the entity was unsuccessful</message></error>
    –batch_7d861d54-175b-46cc-9bf0-8663570c96a9
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    HTTP/1.1 400 Bad Request
    DataServiceVersion: 1.0
    Content-Type: application/json
    Content-Length: 127

    {“error”:{“code”:”bpm.rulesrepo.enum.invalidexternalvalue”,”message”:{“lang”:”en”,”value”:”Managed System is not configured”}}}

     

    I have done all the config mentioned in the post

    Please help

    • Hello Namrata,
      Can you let know the following: (a) destination is created? , (b) Is this on-premise value help API call ?, (c) Have you created Manage Systems and added the destination?, (d) Have you added the this manage system as project properties?

  • Hi Archana Shukla

    (a) destination is created? , Yes

    (b) Is this on-premise value help API call ?, This values are being fetched frm HANA deployed on Cloud Foundry system

    (c) Have you created Manage Systems and added the destination?, Yes have done it as mentioned in blog

    (d) Have you added the this manage system as project properties? Earlier i had not added this but now I did .

     

    I am getting this error now :

    {“error”:{“code”:”bpm.rulesrepo.enum.invalidfilter”,”message”:{“lang”:”en”,”value”:”Managed System response for External Value Help is unsuccesful.”}

    I have not mentioned any value for context path .

    Thanks

    Namrata

    • Can you run the value help URL in your web browser and send me the output, and also the screenshot of how you have configured your service URL mapping.

  • Hi  Archana Shukla,

    Thanks for response ,

    I am using Northwind services

    Entity : Products

    field : ProductName

    The call being made is : comsapProductDetails-1.0.0/Northwind/V2/Northwind/Northwind.svc/$batch

    This returns a list of Product names when bound to ui5 app

    /
    • Ok, everything looks fine. Can you try once again, and if you do not see any thing coming in the value help dialog then will be a Go option next to Hide Advanced Search in top right corner of the dialog – try clicking that and see if you get the results.

      • HI Archana Shukla ,

         

        Tried that option

        But i stil get

        {“error”:{“code”:”bpm.rulesrepo.enum.invalidfilter”,”message”:{“lang”:”en”,”value”:”Managed System response for External Value Help is unsuccesful.”}}}

        I have not provided context path . Am i facing this issue due to that reason

          • Hello Rutuja and Namrata,

            There is an issue with the business rules and therefore you cannot the see the value help. I have raised the support ticket and the issue should be fixed in some time. Will keep you posted.

            In meantime, I tried this with Northwind and it works for me. (a) created a destination, (b) created a system and added that in the manage projects properties, (c) created the service mapping in the data object attribute as shown below, (d) In decision table, when I try to get the value help it shows empty but then I click on the Go button in the same dialog – i get the value help. See the screenshots below. (you may use this as temporary solution!)

             

             

             

             

          • Hi Archana ,

             

            Thanks a lot . This works for me . Let me integrate with Hana cloud data . Will let you know if in case I face any issue However like you said we cannot search for any values / value help does not load automatically

             

             

            Thanks

            Namrata

          • Hi Archana Shukla ,

            Tried the same with hana cloud destination

            Destination : GF_SCP_HANADB – Tested connection 200 ok

            Relative Service URL :  GF_SCP_HANADB/com/YYY/XXXX/allocationset/services/allocationset.xsodata/allocationsetview

            Property Value :
            allocationsetname
            But i am facing the below issue :
            {“error”:{“code”:”bpm.rulesrepo.enum.invalidfilter”,”message”:{“lang”:”en”,”value”:”Managed System response for External Value Help is unsuccesful.”}}}
            The URL works while trying to load metadata from UI5 app
            Please help
          • Hi Archana ,

             

            I am able to load data from Hana Cloud Dest . It was an issue with the credentials in destination . However I have a question . Can the above destination be created at space level as well . When i tried creating it , Value help was not able to identify destination

             

            Thanks

            Namrata

          • No, space level destination would not work, as these space-level-destinations needs destination service instance to be created and then define the destination. Business rules do not have a way to refer to those destination instances.