BRF
BRF
BRF
Creating BRF Application For Calculation of Tax based on the Gross Salary
Flow Chart
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
Customizing clientdependent
transportable or
local
local
8) Goto Signature tab of the function and click Add New Data Objext
15) Right Click in the Context and In the Insert Data object choose Select
Choose ELE_GROSS_SALARY
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
17) Choose Contained objects tab, Choose Expression in Type and Value Range in Expression Type
Create the following value range expression using the above procedure. Using steps 17 - 20
Name of the Value Range
Expression
Incoming Parameter
Vr_Gross_Salary_is_Medium
Values
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
Save and Activate all the Objects in the Application and the Application itself.
Note : Active Objects are indicated by the Green Icon besides the name of the object.
Choose the Function Created, Open the General Screen, General tab and Copy the ID of the
Function, Paste this ID in the program, as shown below
REPORTzrp_calulate_tax_brf.
PARAMETERS:p_g_salTYPEnumc10.
DATA:lr_fuctionTYPEREFTOif_fdt_function,
lr_contextTYPEREFTOif_fdt_context,
lr_resultTYPEREFTOif_fdt_result,
lr_traceTYPEREFTOif_fdt_trace.
DATA:lr_messageTYPEREFTOcx_fdt.
DATA:ls_taxTYPEif_fdt_types=>element_amount,
ls_salaryTYPEif_fdt_types=>element_amount,
lt_tabnameTYPEtabname.
START-OF-SELECTION.
CLEAR:ls_tax.
ls_salary-number=p_g_sal.
ls_salary-currency='INR'.
TRY.
"GetBRFplusfunction
lr_fuction?=cl_fdt_factory=>if_fdt_factory~get_instance()>get_function('7427EA0D6A3B1ED3989AE1F2F7ECEC45').
"SettheBRFplusfunctioncontext(inputvariables)
lr_context=lr_fuction->get_process_context().
lr_context->set_value(iv_name='ELE_GROSS_SALARY'ia_value=ls_salary).
"ProcesstheBRFplusfunction
lr_fuction->process(
EXPORTING
io_context=lr_context"FDT:Context
iv_trace_mode='T'"TraceMode
IMPORTING
eo_result=lr_result"FDT:Result
eo_trace=lr_trace"FDT:Trace
).
lt_tabname=lr_trace->get_trace_db_table().
"RetrievetheBRFplusfunctionresult
lr_result->get_value(IMPORTINGea_value=ls_tax).
WRITEls_tax-number.
WRITEls_tax-currency.
ENDTRY.