2024 Jun 17 4:11 PM - edited 2024 Jun 19 5:56 PM
Hi !
I have created global feature with intention to disable CREATE action - it all works fine but instead of hiding cerate button it is still enabled and when i click it i get popup saying that create action is disabled - any advice on how to disable/hide the create button ?
SAPUI5 Version is 1.96.1
Here is my implementation of get global features:
METHOD get_global_features.
DATA lv_allowed_create TYPE boole_d.
lv_allowed_create = zcl_qm_claim=>get_global_create_allowed( ).
IF lv_allowed_create = abap_false.
result-%create = if_abap_behv=>fc-o-disabled.
ENDIF.
result-%update = if_abap_behv=>fc-o-enabled.
ENDMETHOD.
I discovered thet get_global_features method is not called... my behaviour is defined like this:
unmanaged implementation in class zbp_qm_claims_qmel unique;
with draft;
define behavior for ZQM_CLAIMS_QMEL
draft table zqm_qmel_draft
late numbering
lock master
total etag aedat
authorization master ( instance, global )
etag master aedat
{
create ( features : global );
update ( features : global );
association _qmma { with draft; create; }
field ( readonly ) qmnum, qmart;
//COSTS
field ( features : instance ) zzestimated, zzagreedsup, zzagreedmill,
zzestimated_cur, zzagreedmill_cur, zzfinstatsup, zzfinstatmill,
zzcrdbnote, zzcrnote, txt04;
draft action Edit;
determination setInitialValues on modify { create; }
}
what do I do wrong ?
Request clarification before answering.
Hi there,
try using the annotation @ui.createHidden: true to hide the create button in addition to using global feature control to disable the operation.
This annotation is an entity annotation, that means in CDS view it goes above
define view entity...
and in metadata extension, above
annotate view xxx with { ..
Hope this helps.
Regards,
Jessie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
May I ask what do you mean by 'global action area'?
The annotation I mentioned (plus 2 others for Update and Delete) are used specifically to hide the standard CUD operations buttons, which are
- the create and delete that you see either at the List Report or if in the Object Page, at the tables
- and the update and delete at the top of the Object Page
Regards,
Jessie
@ui.createHidden should be available from ABAP Cloud release 2302 and S/4 HANA OP 2023. If you say you are getting a syntax error when trying to use the annotation, you are probably on an older release. Unfortunately there is no other workaround from RAP or ABAP CDS at the moment, as this behavior is controlled by Fiori Elements, perhaps you could open a ticket with FE and they may have suggestions.
Regards,
Jessie
User | Count |
---|---|
87 | |
9 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.