on 2022 Nov 28 4:54 PM
Hello All,
I have enabled buttons via RAP model. But my main requirement is to enable / disable a particular field based on certain condition within that Update action button.
Consider fields that appear on click of Edit are : Material, Material Description, WBS, Status.
Validation that i want is that if
Status = Created then WBS should be non - editable and Material to be editable and hence, Update should happen.
Status = Released then WBS and Material should be Editable and Update should work.
Basically, Action button should always be enabled, its the field within which need to be enable / disable.
Kindly suggest how to achieve this.
Thanks in advance!!
Shilpi
Request clarification before answering.
Hi Shilpa,
In behavior definition, mention the list of fields which needs to be enabled for dynamic field control and implement the behavior implementation for handling the feature control for the entity.
Pseudo code:
Enable the list of fields in behavior definition.
{
field ( features : instance ) WBS, Material;
...
}Handle the dynamic feature control for fields in behavior implementation.
result = VALUE #( FOR ls_wa IN lt_table
( %tky = ls_wa-%tky
%field-WBS = COND #( WHEN ls_wa-Status = 'created'
THEN if_abap_behv=>fc-o-disabled
ELSE if_abap_behv=>fc-o-enabled )
) ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note: if_abap_behv=>fc-o-enabled is for operation (actions) not for fields.
For fields please use if_abap_behv=>fc-f-mandatory ( or readonly, unrestricted, all).
https://help.sap.com/docs/abap-cloud/abap-rap/instance-feature-control?version=s4_hana
For me such approach generates dump "Handler not implemented; Method: INSTANCE_FEATURE, Involved Entities: ZC_XXXXXXXX"
I did everything correct as book described activated class and behavior. Only difference from example /DMO/FLIGHT is that I added such behavior into associated entity not in the root entity. Have you had such problems?
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.