cancel
Showing results for 
Search instead for 
Did you mean: 

BRF+ => Apply value mapping before passing parameters to a decision table

0 Kudos

Hello,

We're working on a BRF+ implementation and one of the requirements is to transform or map an input parameter prior to passing it as a value for looking up results from a decision table.

Example, a decision table based on the higher level product type. Let's say a tennisball, a football and a basketball all have the higher level product type "Ball". In our decision table we would have a record for US + BALL and then some fields as a result for that combination. But we can only pass "tennisball",.. as values when calling the decision table function.

When I create a function for the decision table I was expecting to be able to do some initializations to transform the values, similar to the "event" type functions that include a ruleset. But this doesn't seem to be possible for a "Functional mode" function.

I've tried creating a second function that would first alter my input parameters and then call the function that is linked to the decision table, but this was a dead end. (don't find a way to call the decision table function from my other function)

Is there a way to change the input parameters of a function call to a decision table? Or can this only be done in ABAP, prior to calling the BRF+ function?

Thanks in advance,

Erik

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hello Patrick,

In your solution, do you use a second function to actually call the decision table or is all controlled from within the event function (Z_DETERMINE_COLLECTION_VALUES in your case)?

In the meantime, I solved it differently:

  1. Created a decision table for mapping a detailed product_type to a higher level product type
  2. Created a decision table to derive the needed details by high level product type and inserted the first decision table as input parameter by expression
  3. Created the function of type "function mode", which then also accepts the detailed product type.

Thanks for your help though. Being new into on BRF+ I missed the insight of passing the results of two different expressions via the context.

Erik

0 Kudos

Hello Patrick,

Thanks for the quick reply! What you suggest is what I initially tried to do to solve this. But I got stuck...

If I create the event mode function module, keeping the same example, passing country + product type as the input parameters. I can change the product type as per my requirements using the options available in the ruleset.

But then, how do I call the decision table from there and how will we be able to call that function from ABAP/Webservice?

Erik

Patrick_Gans
Participant
0 Kudos

Here is what I would do.

1. Create an element called 'Product Type' (In my example that is what 'DFKKCMS' is)

2. Add the 'Product Type' as a Variable in the Ruleset (you can see this in the lower left of the pic)

3. Create a Decision Table that initializes the 'Product Type' (you can see this in the lower right of the pic)

4. Then use 'Product Type' as an input to a subsequent Decision table.

5. You can add your result (the value you want to pass back) as Context in the Function. You do that under "Signature: Add Existing Data Object (or Add New Data Object).

6. Click Create Code Template, and it will give you a template to use for ABAP.

Patrick_Gans
Participant
0 Kudos

Hi Erik,

I would just use Event mode and utilize a ruleset to process the data before the decision table. You can still have a Result Data Object or multiple Context parameters that you can return. That way you can use some type of expression (case statement, decision tree, etc.) to initialize the variable. Hope that helps! Let me know if you have any follow up questions!

Patrick