on 06-22-2022 6:49 AM
Hi All,
So I've created a FIORI Elements app using RAP Model and enabled Multi-select by changing the manifest.json file as documented here. Further, to make sure that the backend is triggered just once on clicking a custom button regardless of number of lines selected, I enabled change set processing for the button as advised here.
However, now if I perform any validation on click of that button and generate a generic error message, the error gets displayed as many times as the number of lines selected in the app before clicking the button.
Example: If there are 10 line items selected on the app and the custom button is clicked, any error generated from the backend gets displayed 10 times even though during debugging, the call to the backend is just once and also the error table is filled just once.
Any leads to help resolve this will be highly appreciated.
Hi Deepak,
I am doing it the first way. I am just populating reported-<projected entity> with my message and this works fine for me. I am not sure what's going wrong in your case.
Thanks,
Aman Garg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
I am doing it the same way and this works fine for me. Although, in my case, we actually wanted the error/success message individually for all the selected items, but I just tried generating a common error message after reading your question, and it worked fine for me. I would be able to help you if you can share a sample code snippet.
Thanks,
Aman Garg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aman,
Thanks for your quick response. Here's the sample code I've been using:
APPEND VALUE #(
%msg = new_message( id = <msg_class> number = <msg_number> severity = if_abap_behv_message=>severity-error )
) TO reported-<projected entity>.
I alternatively tried this way:
READ TABLE keys ASSIGNING FIELD-SYMBOL(<ls_keys>) INDEX 1.
APPEND VALUE #( %tky = <ls_keys>-%tky ) TO failed-<projected entity>.
APPEND VALUE #(
%tky = <ls_keys>-%tky
%msg = new_message( id = <msg_class> number = <msg_number> severity = if_abap_behv_message=>severity-error )
) TO reported-<projected entity>.
Either ways, the 'reported' table is just filled with one entry and still displays that entry as many times as the number of selected lines
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.