Call BRF+ application(interest) in report in ABAP
Refer BRF+ application link- BRF+ basic application
Step1: Goto BRF+ application in edit mode.
Step2: Click on settings and change user mode simple to expert. Click on save.
Step 3: Close BRF+ application and open again.
Step 4: Goto Function and click on create code template.
Step 5: Copy code and paste in report program.
Report
REPORT zab_rp_brf_intrest.
CONSTANTS:lv_function_id TYPE if_fdt_types=>id VALUE '1C98EC1899D41EDEBDC07101629184E0'.
DATA:lv_timestamp TYPE timestamp,
lt_name_value TYPE abap_parmbind_tab,
ls_name_value TYPE abap_parmbind,
lr_data TYPE REF TO data,
lx_fdt TYPE REF TO cx_fdt,
la_pinput TYPE if_fdt_types=>element_text.
FIELD-SYMBOLS <la_any> TYPE any.
PARAMETERS: p_year TYPE zab_dt_year.
****************************************************************************************************
* All method calls within one processing cycle calling the same function must use the same timestamp.
* For subsequent calls of the same function, we recommend to use the same timestamp for all calls.
* This is to improve the system performance.
****************************************************************************************************
* If you are using structures or tables without DDIC binding, you have to declare the respective types
* by yourself. Insert the according data type at the respective source code line.
****************************************************************************************************
GET TIME STAMP FIELD lv_timestamp.
****************************************************************************************************
* Process a function without recording trace data, passing context data objects via a name/value table.
****************************************************************************************************
* Prepare function processing:
****************************************************************************************************
ls_name_value-name = 'PINPUT'.
la_PINPUT = p_year. "[insert CONTEXT VALUE here OR DELETE the line].
GET REFERENCE OF la_PINPUT INTO lr_data.
ls_name_value-value = lr_data.
INSERT ls_name_value INTO TABLE lt_name_value.
CLEAR ls_name_value.
****************************************************************************************************
* Create the data to store the result value after processing the function
* You can skip the following call, if you already have
* a variable for the result. Please replace also the parameter
* EA_RESULT in the method call CL_FDT_FUNCTION_PROCESS=>PROCESS
* with the desired variable.
****************************************************************************************************
cl_fdt_function_process=>get_data_object_reference( EXPORTING iv_function_id = lv_function_id
iv_data_object = '_V_RESULT'
iv_timestamp = lv_timestamp
iv_trace_generation = abap_false
IMPORTING er_data = lr_data ).
ASSIGN lr_data->* TO <la_any>.
TRY.
cl_fdt_function_process=>process( EXPORTING iv_function_id = lv_function_id
iv_timestamp = lv_timestamp
IMPORTING ea_result = <la_any>
CHANGING ct_name_value = lt_name_value ).
CATCH cx_fdt INTO lx_fdt.
****************************************************************************************************
* You can check CX_FDT->MT_MESSAGE for error handling.
****************************************************************************************************
ENDTRY.
WRITE: <la_any>.
Input1
Output1
Input2
Output2
******************************Thank you ******************************
Comments
Post a Comment