cancel
Showing results for 
Search instead for 
Did you mean: 

How to fill target fields of a decision table dynamically

Former Member
0 Kudos

Hi,

BRF+ and his decision tables are used in the area of SAP Revenue Accounting and Reporting. A set of predefined decision tables are delivered and now I want to extend the functionality: Within a decision table I actually want to populate a target field not with a fixed value, but with the result of a function module. Unfortunately I was not able to find an appropriate documentation or find some else who could explain that to me. Therefore I would appreciate if someone of the community could give me a hint.

Thanks and regards

Markus

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Christian,

thanks for you reply. Does the expression have to be assigned to the total column or can I decide line by line of the decision table if a fixed amount or an expression should deliver the field value?

BR

Markus

christianlechne
Active Contributor
0 Kudos

Hi Markus,

you can assign an expression per cell /row. So you can mix constant values, expressions or direct value input

BR

Christian

Former Member
0 Kudos

Hi Christian,

sorry for bothering you again, but I really don't know anybody who is familiar witht this BRF+ staff.

I created an expression (function call) and entered this expression within a target field of a decision table. I also created a function module with exactly the same name as the expression. But when Isimuated the decision table, I could not see that the function module is processed. What did I wrong? Is there an additional link between expression and function module beyond the equality of the names? Thanks for your help.

BR

Markus

christianlechne
Active Contributor
0 Kudos

Hi Markus,

the workflow would be the following:

  1. Create a function module/class with static method that contains your logic for the dynamic determination of the result
  2. Create a procedure call expression (see Procedure Call Expression - Business Rule Framework plus (BRFplus) - SAP Library). You have to assign your function module from step one in this expression in order to get it called and do the mapping of the importing and exporting parameters. When you create the expression be sure that the reuslt data object of the expression is the same as the data object that is defined in your result column of the decision table.
    -> A function call expression (the name is a little bit misleading) is intended to call a BRFplus function not a function module.
  3. Now you can assign the procedure call expression to a cell of the result column (here the build-in search of the BRFplus will only offer you expression with the result data object type identical to the one of the result column of the decision table)

When you now simulate the decision table and the condition columns of the row are fulfilled where you assigned the expression as result your fucntion module should get called.

Hope that helps

BR

Christian

Answers (1)

Answers (1)

christianlechne
Active Contributor
0 Kudos

Hi Markus,

in   general it should be possible to assign an expression as result column. This allows you to assign e. g. a procedure call to populate the result.

In your concrete case it depends on how the the table was delivered. If it is part of a C type application you can enhance it. If it is delivered as part of a S application you have to copy it in your namespace to enhance it.

Hope that helps.

BR

Christian