cancel
Showing results for 
Search instead for 
Did you mean: 

RAP BO, impossible to DELETE table Row

koebelt
Explorer
0 Kudos
371

In a Behavior Definition of a BO, I need to integrate a DELETE query : 

DELETE FROM ztable WHERE id = @existing_row_in_ztable-id

Unfortunately, this doesn't work. At Runtime execution of this snippet, it gives the following error

ABAP Runtime error 'BEHAVIOR_ILLEGAL_STATEMENT'

Now you way rightfully ask: "Are you really trying to delete a row directly from the table ?"
And to That I would respond: "I wanted to delete the row from the Consumption view but Eclipse wouldn't let me."

When trying to delete the row from the Consumption view, it gives the following error: 

Change operations on entities are not yet supported.

So I'm asking for your guidance: How am I supposed to delete a Row from the Table ?

View Entire Topic
patrick_boehm
Explorer

The operations like create, update, delete are normally not support inside a RAP action ( determination, ... ).

You can try it by using the EML Statement for Delete ( if your other table is part of the BO or a different BO ).
Or you implement the additional_save in your BO on the root entity, see here: https://help.sap.com/docs/abap-cloud/abap-rap/implementing-additional-save

koebelt
Explorer
0 Kudos
It is indeed inside an action. I thought that BO's action's goal were to make changes on the table. Is there really no other simple way to execute a DELETE query after an action ?
koebelt
Explorer
0 Kudos
Note that I am able to make Create and Update Queries inside the same action
patrick_boehm
Explorer
0 Kudos
Hm .. then i don't no other way.
patrick_boehm
Explorer
0 Kudos

Hm. Then i don't know other way. I've got always Dump when i used an Insert, Delete or Update Statement directly on the Database inside a RAP Action.

Once i've switche to an EML Statement it was working for me