Hi,
I have created a BRFplus function and added the code for same.
but sometimes output comes and sometimes it does not.
Whenever i make any change in my ABAP code , i need to goto BRFplus function , have to make a change there and activate it .
Then only output comes in lo_result w_t.
below ABAP code is added.
-----------------------------------------------------------------------------------
DATA: lo_function TYPE REF TO if_fdt_function,
lo_context TYPE REF TO if_fdt_context,
lo_result TYPE REF TO if_fdt_result,
e_wa_dref TYPE REF TO data,
lx_fdt TYPE REF TO cx_fdt.
DATA: lo_message TYPE REF TO cx_fdt.
FIELD-SYMBOLS: <fs_any> TYPE any,
<fs_is_final> TYPE STANDARD TABLE,
<fs_message> TYPE if_fdt_types=>s_message.
DATA: ls_werks TYPE if_fdt_types=>element_text,
ls_matnr TYPE if_fdt_types=>element_text,
ls_statm TYPE if_fdt_types=>element_text,
ls_grp TYPE if_fdt_types=>element_boolean,
w_t TYPE REF TO data.
FIELD-SYMBOLS : <d_ref> TYPE ANY TABLE,
<d_ref1> TYPE zctde.
CLEAR : ls_werks,
ls_matnr,
ls_statm,
ls_grp.
MOVE : inp_data-werks TO ls_werks,
inp_data-matnr TO ls_matnr,
'X' TO ls_statm.
TRY.
*"GET BRFPlus Function
lo_function ?= cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function('001E0B8362C21ED39FCE26B763418104').
*" set BRFlus function context(Input variable)
lo_context = lo_function->get_process_context( ).
lo_context->set_value( iv_name = 'MATNR' ia_value = ls_matnr ).
* lo_context->set_value( iv_name = 'MAT_GRP_CHECK' ia_value = ls_grp ).
lo_context->set_value( iv_name = 'STATM' ia_value = ls_statm ).
lo_context->set_value( iv_name = 'WERKS' ia_value = ls_werks ).
* " Process the BRFplus function
lo_function->process( EXPORTING io_context = lo_context
IMPORTING eo_result = lo_result ).
CREATE DATA w_t TYPE STANDARD TABLE OF zctde.
ASSIGN w_t->* TO <d_ref>.
lo_result->get_value( IMPORTING er_value = w_t ).
lo_result->get_value( IMPORTING ea_value = <d_ref> ).
CATCH cx_fdt INTO lx_fdt.
ENDTRY.
-------------------------------------------------------
Kindly suggest is that i need to do every time or there is some issue with my Code?
Regards,
Khushbu