on 2023 Dec 04 5:40 AM
Hi Experts,
I have created an BRF+ application with rule to validate some condition and throw error message.
I have created a log message of type error.
But when simulating the function with this rule, I am getting only message, without any message type.
Also in the generated code, there is no logic to identify message type
Do you have any suggestion to make BRF+ show the message as error?
your design looks correct to me.. neither is there any error on the BRF+ side...
have u already tested calling it from another class... can u share results from that call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
REPORT ztest_brf_mdm01.
CONSTANTS:lv_function_id TYPE if_fdt_types=>id VALUE 'BC305BCE60AA1EDEA2D41D9517A18DA3'.
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_brgew TYPE if_fdt_types=>element_quantity,
la_ntgew TYPE if_fdt_types=>element_quantity.
FIELD-SYMBOLS <la_any> TYPE any.
GET TIME STAMP FIELD lv_timestamp.
ls_name_value-name = 'BRGEW'.
la_BRGEW-number = '34'.
la_BRGEW-unit = 'KG'.
GET REFERENCE OF la_BRGEW INTO lr_data.
ls_name_value-value = lr_data.
INSERT ls_name_value INTO TABLE lt_name_value.
CLEAR ls_name_value.
****************************************************************************************************
* Let BRFplus convert your data into the type BRFplus requires:
* Data object is bound to a DDIC type, so you can improve performance by passing a variable of that type.
* If you pass a variable of this type, you should indicate this by passing "abap_true" for parameter "iv_has_ddic_binding".
****************************************************************************************************
ls_name_value-name = 'NTGEW'.
la_NTGEW-number = '67'.
la_NTGEW-unit = 'KG'.
GET REFERENCE OF la_NTGEW 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.
ENDTRY.
WRITE: <la_any>.
This is the code I used which I got from code template.
When checked in debugger, <la_any> is just storing the message id
and no exceptions are raised
can u paste the final snapshot from simulation result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
from your snapshot it looks when BAL_LOG_ADD_* FM is called message type is correctly passed as 'E'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.