3 weeks ago - last edited 2 weeks ago
Hello,
I have a Fiori Elements app (List Report and Object Page) built with a managed, draft enabled ABAP RAP business object, exposed in an OData V4 service. The root entity includes an attachment (LOB) field.
When I upload an attachment via the Object Page, the new file only becomes visible after I manually refresh the page. This happens both in the deployed app and in the SAP Business Application Studio (BAS) preview. However, in the Eclipse ADT preview, the new attachment shows up immediately after upload (no manual refresh needed). Moreover, if I expose the exact same RAP BO in a OData V2 service, the problem also does not occur in the deployed app.
I noticed that:
In the Eclipse ADT preview, the $batch request executed after file upload contains both a PATCH (for the upload) and a follow-up GET (which refreshes the entity/attachment list).
In the deployed app/BAS preview, the batch request only contains the PATCH; the GET is missing, so the UI doesn’t update until I refresh.
However, the SAP UI5 framework version is same in all environments (1.120.15).
I attempted to solve this using side-effects, but without any success.
Does anyone know what might cause the difference and/or how it can be solved?
Thanks in advance!
Request clarification before answering.
Eventually I solved this using a side effect in the XML-annotations with the attachment as both the source and target field:
<Annotation Term="Common.SideEffects" Qualifier="fileUploaded">
<Record Type="Common.SideEffectsType">
<PropertyValue Property="SourceProperties">
<Collection>
<PropertyPath>Attachment</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="TargetProperties">
<Collection>
<String>Attachment</String>
</Collection>
</PropertyValue>
</Record>
</Annotation>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @anoukvandenengel,
I am facing the same issue, and I did try adding sideEffects as per your solution.
I am update the metadata.xml as below then execute npm run build and npm run deploy for the App.
so far, the new attachment still not shows up immediately after upload. Kindly advise is there any step missed out.
Thanks in advance.
Regards,
WC
Hello @Thiangwc,
Have you added this using the Guided Development tools in BAS?
I edit the metadata file via VS code and redeployed the app.
Cross check the xml file in backend system via se80 and it was updated.
Thanks.
User | Count |
---|---|
71 | |
18 | |
10 | |
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.