cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-select FIORI Elements App repeats any error for as many lines are selected

deepak_pandey
Advisor
Advisor

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.

svenja_unger
Explorer
0 Kudos

Hi! I have the same problem now. Did you find a way to solve it?

deepak_pandey
Advisor
Advisor

Hi Svenja,

I haven't found a proper solution yet. Still awaiting a response that actually works for me!!

However, I did find a workaround. In case you want to display a generic message regardless of the number of lines selected, you could use the severity as 'Information' instead of 'error', if the message type isn't a showstopper for you. It doesn't repeat the message with severity as 'information' or 'success' or 'none'.

APPEND VALUE #(
%msg = new_message( id = <msg_class> number = <msg_number> severity = if_abap_behv_message=>severity-information )
) TO reported-<projected entity>.

Also, 'information', 'success' and 'none' type single line messages are displayed as Message Toasts and disappear after a while. In case you want it to stay on the screen until you explicitly close it just like 'error' types, break your single line message into more than 1 line and it will come as a pop-up message with close button & won't repeat for the number of line items selected.

dhegde
Participant
0 Kudos

Hello Deepak

I tried this in BTP Trial account. As long as I fill the message for a specific projected entity i.e. `reported-<projected_entity>` (with or without filling the keys), it is not repeated. Without keys, it appears for the first selected instance.

Only when the message is filled into `reported-%other` that it gets repeated once for each selected instance even though it is filled only once in the implementation.

Clearly, you are not doing this. So, it is strange why it is not working for you.

Let's hope someone as an answer.

Cheers,

Dhananjay

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member14709
Contributor
0 Kudos

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

former_member14709
Contributor
0 Kudos

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

deepak_pandey
Advisor
Advisor
0 Kudos

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