Skip to Content

This document is prepared based on SAP HANA Version SPS05 Revision 47.

While creating the decision table we will specify Conditions and Actions.

If the conditions on an attribute are not specified in proper order then while validating, we get error.

In one of my previous documents I showed how to create decision table  and used conditions in an order such that while validating it should not throw any error. I would like to request you to go through my previous document, if you had not seen before. Click here

In Step 9 of that document, there is a screenshot with number 5 enclosed in a circle, where the condition on attribute (SAL) is in proper order and the same screenshot is pasted below.

                   CondActions in Order.JPG

Now let us change the second condition to SAL > 9001 as shown below and validate the decision table. Below is the result of validation

          ValError.JPG

The error is due to missing range found in second condition of SAL attribute.

What missing here is there is no condition for SAL = 9001 in the above two conditions.

While modeling for a requirement there is a chance that there will be no business rules for some of the scenarios and hence we can avoid those while creating decision table.

Actually while validating, in the background there are many validation rules which goes through and we can find those validation rules by navigating through Windows -> Preferences -> Expand Modeler -> Click Validation Rules.     ValRules.JPG 

We will observe that under Decision Table section, “Decision Table Check Consistency Rule” is checked. To avoid the validation error on missing range, uncheck this validation rule and click ok.

Now again validate our decision table and this time, status will be Completed Successfully.

Its just a small trick

Thank You.

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Henrique Pinto

    But in this case, what happens in case you do have SAL = 9001 in your record?

    Does the proc throw an error, or it just reads null?

    Maybe forcing TOTAL_SAL to be ‘0’ for these ranges would be the best compromise…

    Also isn’t there an “ELSE” or “DEFAULT” condition you could force on SAL?

    (0) 
    1. Raj K Post author

      Hi Henrique,

      Thats a good question. Here is the partial proc

      CASE WHEN “SAL” <= 9000   THEN SAL+(COMM*1.5)

                WHEN “SAL” > 9001     THEN SAL+COMM

      ELSE 0

      END AS TOTAL_SAL

      If there is no record with SAL = 9001, it does not throw any error and as I used the parameter as action (table will not be used for update), it will create a Return value in _sys_bic and there will be no update to record as it does not exist.

      If the record exists, it will place default value (0 in this case) for TOTAL_SAL due to ELSE condition of 0.

      Regards

      Raj

      (0) 
      1. Henrique Pinto

        Hi Raj,

        great, thanks for the reply.

        So, that “ELSE 0” was added manually by you or was it automatically added by HANA?

        If so, I don’t see why it should block the activation at all; it could just be a warning.

        (0) 
        1. Raj K Post author

          Hi Enrique,

          The ELSE part was added automatically.

          The reason for blocking is simple. It just goes through the validation rules as defined in preferences. Thats why we are removing that validation check 🙂

          Its better if SAP makes that validation check optional, instead of mandatory.

          Regards

          Raj

          (0) 
  2. Seshadri Sreenivas R

    Hi Raj,

    This is a very valid scenario and a solution to it but it should be noted that this is a global setting.

    But, there could be a scenario when a few decision tables (DT) need to have such validations and few others need not. In such a case, the solution proposed will ‘always’ skip the missing range check, which in turn doesn’t help those decision table which needs the check.

    In those cases, the better way is to activate the DT, which doesnt need the missing range validation, by right clicking on the DT in ‘Navigator’ panel. In the activation pop-up, choose ‘Bypass Validation’.

    Regards

    Sesh

    (Developer, Decision Table on HANA)

    (0) 
    1. Raj K Post author

      Hi Sesh,

      I guess in the future releases SAP might come with better options with missing range error in Decision table, if someone might take initiative.

      Regards

      Raj

      (0) 

Leave a Reply