SAP-samples / abap-platform-fiori-feature-showcase

Feature showcase that demonstrates and documents how to implement annotation-driven SAP Fiori Elements UI features for oData V4, using the ABAP RESTful Application Programming Model (RAP).
Apache License 2.0
169 stars 37 forks source link

Side Effect Not Occurring When Deleting Child Entity in Object Page #16

Closed pakornthav closed 4 months ago

pakornthav commented 4 months ago

The expected side effect is not taking place when attempting to delete a child entity within the object page.

I follow the instructions of RAP110 image

and I cannot find details about deleting child entities and triggering determination calculateTotalPrice

I also try this workaround https://github.com/SAP-samples/abap-platform-fiori-feature-showcase/blob/main/04_object_page_general.md#entity-affects-field-workaround but it still not working

RupertNold commented 4 months ago

Hello,

I had the same problem and have opened a SAP ticket (Case 1139198/2023). The following workaround was recommended:

We have created an empty dummy determination to use it as a side effect trigger. Because the determination can be used "on entity _Items". The trigger "On entity" includes also the deletion.

determination DetDummy on save { create; } … determine action ActDetDummy { determination ( always ) DetDummy; } … side effects { determine action ActDetDummy executed on entity _Items affects field TotalAmount; }

It is working, but is is not really nice :-(

The perfect solution would be to allow "entity" as a side effect trigger: side effects { entity _Items affects field TotalAmount; } But this does not exist jet..

Kind regards, Rupert

jessie-cheah commented 4 months ago

Hi pakorn,

can you please share the instructions of RAP110 that you followed? Workaround from Rupert is (for the moment) the recommended way to do it, which is also described in the FSA Guide.

Regards, Jessie

pakornthav commented 4 months ago

Hi pakorn,

can you please share the instructions of RAP110 that you followed? Workaround from Rupert is (for the moment) the recommended way to do it, which is also described in the FSA Guide.

Regards, Jessie

Hi Jessie, I followed Excersice 9 from RAP110 tutorial https://github.com/SAP-samples/abap-platform-rap110/blob/main/exercises/ex09/README.md

Regards, Pakorn

pakornthav commented 4 months ago

Hello,

I had the same problem and have opened a SAP ticket (Case 1139198/2023). The following workaround was recommended:

We have created an empty dummy determination to use it as a side effect trigger. Because the determination can be used "on entity _Items". The trigger "On entity" includes also the deletion.

determination DetDummy on save { create; } … determine action ActDetDummy { determination ( always ) DetDummy; } … side effects { determine action ActDetDummy executed on entity _Items affects field TotalAmount; }

It is working, but is is not really nice :-(

The perfect solution would be to allow "entity" as a side effect trigger: side effects { entity _Items affects field TotalAmount; } But this does not exist jet..

Kind regards, Rupert

Hi Rupert,

I try this and it is working Thank you

Regards, Pakorn