on 2025 Mar 19 10:27 AM
Hi,
i have a fiori elements app based on the list report floorplan. It allows me to do CRUD operations on a custom table. I added a factory action that allows users to select multiple entries, enter the actions parameter "Year" and then all entries are being duplicated with the newly entered year.
The Problem: When doing this, the list report won´t update. I need to manually press "Go" to also have the newly created entries in the list.
factory action copyEntries parameter Z..._INPUT_copyEntries [1];
Implementation of the factory action:
METHOD copyEntries.
DATA: create_duedates TYPE TABLE FOR CREATE z...\\DueDates.
DATA(new_year) = VALUE #( keys[ 1 ]-%param-period_year OPTIONAL ).
READ ENTITIES OF z... IN LOCAL MODE
ENTITY DueDates
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(r_duedates_to_copy)
FAILED DATA(f_diedates_to_copy).
create_duedates = VALUE #( FOR duedate IN r_duedates_to_copy
( %cid = keys[ %key-Companycode = duedate-Companycode
%key-Period = duedate-Period
%key-Periodyear = duedate-Periodyear
%key-Type = duedate-Type ]-%cid
%data = CORRESPONDING #( duedate MAPPING Periodyear = DEFAULT new_year ) ) ).
MODIFY ENTITIES OF z... IN LOCAL MODE
ENTITY DueDates
CREATE FIELDS ( Companycode Duedate Period Periodyear Type )
WITH create_duedates
MAPPED mapped.
ENDMETHOD.
I already tried adding a side effect, but that did not change anything
side effects {
action copyEntries affects $self;
}
Does anyone have an idea?
Technical background: S/4HANA OP 2023, minUI5 version 1.120.0
Request clarification before answering.
Hi @jheisler,
In order for you to request newly created record, you've to re-request the record from the entity on which List report has been bound.
I can think of couple of options using which you can achieve this -
1. Option 1 - You've to ensure you're passing right combination of Key and %CID in mapped parameter of action.
I've uploaded a video on our YouTube channel for the same.
Please Checkout - https://youtu.be/aCzCIAvYDkg
thanks @mainak-aich for the input.
2. Option 2 - add a local annotation on your Fiori LR to refresh the list report table -
<Annotations Target="SAP__self.copyEntries(SAP__self.RelevantEntityType)">
<Annotation Term="Common.SideEffects">
<Record Type="Common.SideEffectsType">
<PropertyValue Property="TargetEntities">
<Collection>
<NavigationPropertyPath>/service/RelevantEntitySet</NavigationPropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations >
Refer this documentation for more details.
2. Option 3 - Find an hook or handler method on UI and trigger refresh/rebind for the list report table.
Hope this resolves your query.
Please accept the solution if it does.
Regards,
Follow on LinkedIn
Subscribe to our YouTube Channel - ClearQueries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @jheisler,
I've prepared short video explaining how to solve the issue you are facing.
I've also updated the answer posted above. With this approach, you should be able to achieve the required behavior without any backend or UI side effect, solely using RAP Action implementation.
Checkout the video - https://youtu.be/aCzCIAvYDkg.
Thanks.
User | Count |
---|---|
68 | |
16 | |
12 | |
7 | |
7 | |
4 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.