cancel
Showing results for 
Search instead for 
Did you mean: 

Is it posible to get rule values from abap program?

Former Member
0 Kudos

Hi!

A report calls a method to process a BRF+ function using the code generated by FDT_TEMPLATE_FUNCTION_PROCESS.

This function calls the following rule:

Is it posible to get the values (KZ, ZP) from the abap program mentioned above so users can know which document types are used in this validation?

Thanks!

Cristian

Accepted Solutions (1)

Accepted Solutions (1)

christianlechne
Active Contributor
0 Kudos

Hi Cristian,

the code that you call in order to process the function usually returns only the result data object (usually because you have the option to return changed context parameters too). I guess that this information is not part of the result data object and, hence not accesable from the calling program.

You have several options depending on your requirements in general:

  • You can add this information to the result data object, but I would guess that you will run into further scenarios in your rules processing where you want to return to the caller why a rule returns a specific result
  • So you have a further option to add a table (either to the result data object or to the context of the function; in the later case be aware to create the right coding template namely the one which returns changed context parameters) and put the information in that table. This would be a more generic solution than the first option.
  • If you really want to analyze your rule processing it might alo be an option to use the lean trace functionality which in general traces the complete function execution

The difference between the second and the third option is that within the second option you can define which information concerning the rule processing is handed over to the caller/user while in the third option you have the complete information on the rules processing

Hope that helps

BR

Christian

Former Member
0 Kudos

Thanks for your reply!

Is there a class/method that get the rule details as brfplus transaction do?

Regards,

Cristian

christianlechne
Active Contributor
0 Kudos

Hi Cristian,

yes there is an API to enable the interaction between ABAP coding and the BRF+.

The object you are searching for is the query object. Here is a coding example

In line 61 you fetch a refrence to a query object by specifiying the object type and the expression type id (for valid values see interface IF_FDT_CONSTANTS).

In line 65 you create the selection criteria namely the queryfields (for valid values see interface IF_FDT_ADMIN_DATA_QUERY).

In line 74 you fetch the data using the query object. Let us assume that only one result is possible.

In line 81 you create an object for the search result.

You find further examples in your system in the report FDT_DEMO_QUERY_OBJECTS.

Do not try to to fetch the data via direct SELECTs using the FDT DB tables. The only valid way is the usage of the API classes to deal with that data.

BR

Christian

Former Member
0 Kudos

Thanks a lot!!

Your answers guide me to the class/method to get the values.

After using GET_EXPRESSION method, I call the method GET_CONDITION_RANGE (IF_FDT_RULE).

Thanks again!

Cristian

0 Kudos

Hi Christian,

Can you share the sample code of how you got the values?


Appreciate the help.

Aditya.

Answers (0)