Skip to Content

Hi Guys, It has been long time going through tutorials, practicing and creating applications in BRF+ for my clients. I would like to share few of my learnings.

TCODES USED:

     I have come to know that we can access BRF+ with three different t-codes, namely – BRF+, BRFPLUS and FDT_WORKBENCH. This piece information may  be too old but I feel like mentioning it in case anyone doesn’t know it.

DYNAMIC PROGRAMMING:

We can create a BRF+ application from scratch via dynamic programming to assess its performance. We can even add elements, functions, rules and rule sets via dynamic program to already existing application.

             Search programs based on FDT_TUTORIAL*, It shows a list of few dynamic programs.

TABLES USED W.R.T. STORAGE TYPE:

     Applications created in BRF+ can have below storage types. Once an application is created with a storage type then its storage can’t be changed.

Storage Type

Client

Transport

Cross-Application Usage

System

client-independent

transportable or local

Can use system objects.

Customizing

client-dependent

transportable or
  local

Can use system and
  customizing objects.

Master Data

client-dependent

local

Can use system,
  customizing, and master data objects.

Storage Type

Table Local Objects

Table for Transportable Objects

System

FDT_ADMN_0000S

FDT_ADMN_0001S

Customizing

FDT_ADMN_0000

FDT_ADMN_0001

Master Data

FDT_ADMN_0000A

FDT_ADMN_0001A

NOTE –  I believe I could get the table information right. Please let  me know if I am wrong. I would like to make corrections regarding this.

USEFUL PACKAGES AND PROGRAMS:

            Look in the Package ‘SFDT_DEMO_OBJECTS’, SAP has provided examples for almost all possible scenarios in BRF+.

HOW TO CALL BRF+ FROM ABAP:

          I have seenmost of the people use and recommend below kind of approach to call a function in a BRF+ application.

________________________________________________________________________________________________

                 CONSTANTS:  c_function_id       type fdt_uuid value ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX’.

                DATA:               lo_fuction             type ref to if_fdt_function,

                                           lo_context           type ref to if_fdt_context,

                                           lo_result              type ref to if_fdt_result,

                                           lv_result              type ref to data,

                                           lo_message        type ref to cx_fdt.

             FIELD-SYMBOLS:

                                          <result>               type any.

TRY .

        ” Get BRFplus function

      lo_fuction ?= cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function(  C_FUNCTION_ID  ).

      ” Set the BRFplus function context ( input variables )

      lo_context = lo_fuction->get_process_context( ).

**–Call below line for no of input paramters, iv_name = inpur paramter and ia_value = its value

      lo_context->set_value(   iv_name  = ‘ ‘ ia_value = ‘ ‘  ).                                       

      ” Process the BRFplus function, pass input paramter values and fetch the output 

      lo_fuction->process( EXPORTING  io_context   =  lo_context

                                        IMPORTING  eo_result     =  lo_result ).

     ” Retrieve the BRFplus function result into field symbol <result>

        create lv_result.  

       assign lv_result->* to <result>.

       lo_result->get_value( IMPORTING ea_value = <result>   ).

 

       CATCH cx_fdt INTO lo_message.     

  ENDTRY.

________________________________________________________________________________________________

        Though above code is very easy to understand, many a time one may get confused and lost in the program in a complex scenario. BRF+ provides two  other ways to call a function of an application from ABAP.

1. Go to an application -> Go to a Function -> In the Detail tab Click on ‘Create Code Template’ and use the piece of code in ABAP program to call that function.

Create Code Template.jpg

      Slect Show comments and click on Apply as shown below.Click on Apply.jpg

          Code is generated as shown below, which can be used in ABAP program to call function of BRF+ application.

    Code is Generated.jpg

2. In the Menu bar -> go to Tools ->Function Module Generation (RFC) -> Select required Function from an application and either create a
Function group with a function module or specify existing Function group and mention a new function module to get created ->Generate.

          Required Function module is generated which will have logic to call required function with input Parameters and output Parameters as defined for the function. This function module can be used to call function of a BRF+ application from anywhere in ABAP.

Select RFC.jpg

         Select the required Function and create a Function module [ Create a function group it one deoesn’t exists and check the box create function group ]

and for local object check the local object else mention the required package for functional module as shown below.

Select Function.jpg

   And upon clicking on ‘Generate’

  Generate.jpg

And execute the Function module as shown below

execute the FM.jpg

  This Function module has same inputs as in Function and results the output same as Function. This Function module can be used anywhere in ABAP to call the required function ‘DETERMINE_STR’.

CATALOG:

                   Creation of Catalog is very useful for Functional Consultants and Users who maintain Business rules in the Final system. Functions of either same application or different applications can be grouped together in a Catalog.

             Consider an application ZPO_BRF+ which has few functions related to Purchase Order and ZPR_BRF+ which has few functions related to
Purchase Requisition and ZMIGO_BRF+ which has few functions related to Goods Receipt and Goods Issue.

                  
Then we can create a Catalog as Logistics_MM and can add all the functions from the above applications [only if all the applications have level
as Global or related via a hierarchy]. It makes User / Functional Consultant easier to maintain all the business rules for which he is responsible for.

To report this post you need to login first.

4 Comments

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

  1. Carsten Ziegler

    Interesting blog. Different from all the other ones.

    Concerning storage types and tables:

    Tables ending with a T should be ignored as they are used for a very special SAP-internal purpose. Master data content is written into tables ending with an A such as FDT_ADMN_0000A. Anyway you should not directly access BRFplus tables but use the API instead. There is also a query for more complex reads on BRFplus data (Factory->Query->SELECT).

    (0) 
  2. Valentin Huber

    Hi Siva,

    I suggest you take a look at the transaction FDT_HELPERS. Using it one can find and jump to many usefule BRF+ related tranactions.

    Kind regards,

    Valentin

    (0) 
  3. Vinod Kumar

    Hi,

    Very useful document, thanks for sharing. 

    Just to add, menu options for points 1 & 2 mentioned in document (‘Create code template’ & ‘Function module Generation (RFC) ) are available only if User mode is set to “Expert” in personalization settings.

    /wp-content/uploads/2014/11/brf_583696.jpg

    Regards,

    Vinod

    (1) 

Leave a Reply