Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jul 01, 2019 at 02:14 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 01, 2019 at 02:55 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

      ruleset.png (16.5 kB)
  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2019 at 01:00 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.