Creating a Sample BRFPlus Application

Creating BRF Application For Calculation of Tax based on the Gross Salary

Flow Chart

1) Goto Tcode = BRFPLUS or BRF+ (BRFPlus Workbench) 2) Goto Context Menu and Create an BRF Application .

4) Goto Contained Objets Tab of the created appliaction. and master data objects. Customizing clientdependent transportable or local Can use system and customizing objects. Master Data clientdependent local Can use system.3) Fill the details and choose Storage type The following table summarizes how the storage type of an application affects the usage of objects that belong to it: Storage Type Client Transport Cross-Application Usage System clientindependent transportable or local Can use system objects. customizing. Choose Type as Function and Create object .

.

5) Enter funtion Name and Description 6) Under Properties tab Choose Mode : Functional Mode Assign Top Expression : Create .

7) Choose Decision Tree in Type Enter Name and description .

8) Goto Signature tab of the function and click Add New Data Objext .

9) Choose Element in Type Choose Amount in Element Type .

10) In the Signature tab for the Result data object Choose Create .

11) Choose Element in Type Choose Amount in Element Type .

12) Click on the Created Application goto Contained Objects tab. Formula in Expression Type 13) Enter Details . Choose Expression in Type.

14) In the Result Data Object Choose Select Choose ELE_PAYABLE_TAX_AMOUNT .

15) Right Click in the Context and In the Insert Data object choose Select Choose ELE_GROSS_SALARY .

3) Repeat Steps from 12 to 16 using above Information .25000 INR) * 0.2) + ((Gross_Salary 100000 INR) * 0.1) + Fr_Calculate_Tax_for_med_salary ELE_Payable_Tax_Amount (Gross_Salary .2 (25000 INR * 0.16) Press the * and then click on the Number button and enter 0.1 Save the Formula Create the following formula expressions for the mid and high salary segments using the above procedure. Name of the Formula Expression Result Data Object Formula (25000 INR * 0.1) + (75000 Fr_Calculate_Tax_for_high_salary ELE_Payable_Tax_Amount INR * 0.

17) Choose Contained objects tab. Choose Expression in Type and Value Range in Expression Type 18) Fill in the Details .

19) Click on Set an incoming parameter and Choose ELE_GROSS_SALARY .

20) Create Condition as Shown below Create the following value range expression using the above procedure. Using steps 17 . Values . Amount 100000 and INR as the currency.20 Name of the Value Range Expression Incoming Parameter Vr_Gross_Salary_is_Medium Choose value range as is less Choose ELE_GROSS_SALARY data than object.

21) Goto the Decision tree created before. Choose ELE_PAYABLE_TAX_AMOUNT as Result Data Object. also Right Click on the Decision Tree choose Set Condition -> VR_GROSS_SALARY_IS_LOW .

In the False Part Set Condition VR_GROSS_SALARY_IS_MEDIUM. .22) In the True Part assign FR_CALCULATE_TAX_FOR_LOW_SAL.

In the false Part Set Condition VR_GROSS_SALARY_IS_MEDIUM .

In the True Part assign as shown below. .

Note : Active Objects are indicated by the Green Icon besides the name of the object. we can see the Calculated Tax Amount ii).Enter Amount Less than 100000 INR and Execute. we can see the Calculated Tax Amount .Enter Amount Less than 25000 INR and Execute.Enter Amount Greater than 100000 INR and Execute. Save and Activate all the Objects in the Application and the Application itself.In the False Part assign as shown below. we can see the Calculated Tax Amount iii). i). Now goto the function and Click on start Simulation.

. as shown below REPORT  zrp_calulate_tax_brf. Open the General Screen. General tab and Copy the ID of the Function. Paste this ID in the program.Calling a BRFPlus Application from a program Choose the Function Created.

DATA: lr_message    TYPE REF TO cx_fdt.     " Get BRFplus function     lr_fuction ?= cl_fdt_factory=>if_fdt_factory~get_instance( )>get_function( '7427EA0D6A3B1ED3989AE1F2F7ECEC45' ).     WRITE ls_tax-number. START-OF-SELECTION.   ls_salary-currency  = 'INR'.       ls_salary   TYPE if_fdt_types=>element_amount.     lt_tabname = lr_trace->get_trace_db_table( ).   ENDTRY. DATA: ls_tax      TYPE if_fdt_types=>element_amount.     WRITE ls_tax-currency.     " Set the BRFplus function context ( input variables )     lr_context = lr_fuction->get_process_context( ).       lr_result     TYPE REF TO if_fdt_result.       lr_context    TYPE REF TO if_fdt_context.   ls_salary-number    = p_g_sal.   CLEAR: ls_tax.       lt_tabname  TYPE tabname.     " Process the BRFplus function     lr_fuction->process(       EXPORTING         io_context    =   lr_context  " FDT: Context         iv_trace_mode =  'T'   " Trace Mode       IMPORTING         eo_result     = lr_result    " FDT: Result         eo_trace      =   lr_trace  " FDT: Trace     ).   TRY .     " Retrieve the BRFplus function result     lr_result->get_value( IMPORTING ea_value =  ls_tax ). .PARAMETERS: p_g_sal TYPE numc10.     lr_context->set_value( iv_name  = 'ELE_GROSS_SALARY' ia_value = ls_salary ). DATA: lr_fuction    TYPE REF TO if_fdt_function.       lr_trace      TYPE REF TO if_fdt_trace.