on 10-25-2013 12:43 PM
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.
Hi
Try to assign your SOURCE_FIELDS-/BIC/ZINDCOST ahead ot the try.
l_indcost= SOURCE_FIELDS-/BIC/ZLABCOST.
...
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 = l_indcost ).
...
have a look here: http://abapdevblog.blogspot.ch/2012/10/calling-brfplus-function-from-abap.html
hope that helps
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can post this in ABAP development forum.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.