on 2022 Apr 06 1:52 PM
I try to add some feature control to my RAP model. I only want to allow the deletion of draft items (item is a child of my root node) which don't have an active instance yet.
When disallowing deletion, new items (drafts) could not be deleted as well, so this is not a good option.
So adding feature control for the delete function could be an option:
delete( features : instance);
But within the feature control method "get_instance_features", I only want to allow deletion for items which doesn't have an active entity. How to achieve this?
Within the ABAP Fiori programming model with BOPF there was field available called "hasactiveentity".
andre.fischer Any ideas?
Thanks in advance!
Mattijs
I am disabling the edit button im my RAP Generator UI when the job for generating the repository objects has been scheduled.
There the action %action-edit is disabled or enabled based on the content of the field jobname in the entity rapbo.
But I assume you should be able to adapt it for your needs as follows:
%action-delete = COND #( WHEN rapbo-%is_draft = if_abap_behv=>mk-on
THEN if_abap_behv=>fc-o-enabled
ELSE if_abap_behv=>fc-o-disabled )
line 609 ff.
result = VALUE #( FOR rapbo IN rapbos
( %tky = rapbo-%tky
%field-packagename = COND #( WHEN rapbo-packagename IS INITIAL
THEN if_abap_behv=>fc-f-mandatory
ELSE if_abap_behv=>fc-f-read_only )
%field-namespace = COND #( WHEN rapbo-packagename IS NOT INITIAL
THEN if_abap_behv=>fc-f-mandatory
ELSE if_abap_behv=>fc-f-read_only )
%action-edit = COND #( WHEN rapbo-jobname IS INITIAL
THEN if_abap_behv=>fc-o-enabled
ELSE if_abap_behv=>fc-o-disabled )
%action-createbo = COND #( WHEN rapbo-%is_draft = if_abap_behv=>mk-off AND
rapbo-jobname IS INITIAL
THEN if_abap_behv=>fc-o-enabled
ELSE if_abap_behv=>fc-o-disabled )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andre,
Is there a similar option available in ABAP Programming model for Fiori?
Below annotation makes 'Delete' enable. But if the instance should not be deleted for any particular condition, is there any similar way as in RAP to control this standard delete function?
If there is none, then plan B is to disable DELETE and add custom action
Thanks
Shabnam
User | Count |
---|---|
70 | |
11 | |
10 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.