on 2018 Feb 09 8:06 AM
Hello SAP Experts,
I have as backend system SAP Netweaver 7.50 SP5 and as frontend system SAP Fiori Frontend Server 3.0. I generated a SAP Fiori Elements Application based on ABAP CDS View annotations (according to ABAP Programming Model on SAP Fiori) and I defined a custom BOPF action on the generated BOPF BO in order to perform a custom action.This action was also exposed via the annotation @UI.lineItem: [{ position: 10, type: #FOR_ACTION, dataAction: 'BOPF:ACTION_NAME', label: 'Action Test' }].
The actions should not be executable in case of certain conditions and therefore I implemented a Action Check for this action giving an error message in case that the action cannot be executed. My problem is that on UI side, the application shows an generic error message "This action cannot be performed for the selected object." and not the error message which I am providing within the BOPF action check...Could you please tell me if there is a SAP Note already which corrects this issue on Netweaver 7.50 SP5?
PS: I have the same application on another backend system with SAP Netweaver 7.51 SP2 and there the right error message is shown on UI side.
Request clarification before answering.
Hello ,
Since I recently faced the same issue, I am posting one of the possible solution for the same.
When the error is received from the BAPIRET table, the following could be used for populating the error message:
lv_message = <fs_msg>-message.
CREATE OBJECT lo_cm TYPE /bobf/cm_frw_symsg
EXPORTING
severity = /bobf/cm_frw_symsg=>co_severity_error "Specify Severity here
symptom = /bobf/if_frw_message_symptoms=>co_bo_inconsistency
lifetime = /bobf/if_frw_c=>sc_lifetime_set_by_bopf
mv_attr1 = <fs_msg>-message_v1
mv_attr2 = <fs_msg>-message_v2
mv_attr3 = <fs_msg>-message_v3
mv_attr4 = <fs_msg>-message_v4
message_text = lv_message
ms_origin_location = VALUE #(
bo_key = zif_i_inf_c=>sc_bo_key
node_key = zif_i_inf_c=>sc_node-main_node
key = <fs_key>
).
eo_message->add_cm( EXPORTING io_message = lo_cm ).
" It is important to set the flag as false, else program ends in short dump
ev_static_action_failed = abap_true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you find a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
11 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.