Skip to Content
0
Former Member
Oct 25, 2013 at 11:43 AM

Calling a BRF+ function in SAP BW

85 Views

Hallo Experts,

i ve used the following Routine code to consume the BRF+ Fuction in SAP BW transformation. I get an error message saying that the first input value(ZINDCOST) is not assigned even if I have assigned the same. Can anyone show me the error in the code of calling the BRF+ function?

Thanks in advance.

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,

lv_zcosts TYPE /BIC/AZBRFADSO00-/BIC/ZCOSTS,

lx_fdt TYPE REF TO cx_fdt.

FIELD-SYMBOLS <ls_message> TYPE if_fdt_types=>s_message.

" Get BRFplus function

lo_function = CL_FDT_FACTORY=>IF_FDT_FACTORY~GET_INSTANCE(

)->GET_FUNCTION( IV_ID = '0050568D00701EE38F8457ED6EBDFBF3' ).

TRY.

" Set the BRFplus function context ( input variables )

lo_context = lo_function->get_process_context( ).

lo_context->set_value( iv_name = 'INDCOSTS_A' ia_value =

SOURCE_FIELDS-/BIC/ZINDCOST ).

lo_context->set_value( iv_name = 'LABORCOSTS_A' ia_value =

SOURCE_FIELDS-/BIC/ZLABCOST ).

" Process the BRFplus function

lo_function->process( EXPORTING io_context = lo_context

IMPORTING eo_result = lo_result ).

" Retrieve the BRFplus function result

lo_result->get_value( IMPORTING ea_value = lv_zcosts ).

CATCH cx_fdt INTO lx_fdt.

ENDTRY.

RESULT = lv_zcosts.