on 2020 Apr 24 10:53 AM
Hello Experts,
Is editing the key field values of a table are not controlled in ABAP restful programming ?
I have a managed application and in my table there are three key fields . So when the user clicks on the line to edit in the report, in my mind the key fields should be disabled to edit. (Same like in SAP ECC). But the issue is, it is not doing so automatically and no validation code is working on the key fields. When i try to control editing using the below statement in the behaviour definition .
Update
field (read only) Field1 ;
it is coming as non-Editable. But then when i try to create a new record still these fields are non editable. Is this a bug or is it something we have to handle using unmanaged behaviour.
Hope i made myself clear.
Request clarification before answering.
field (mandatory:create| readonly:update); Adding readonly:update will make the entity read only for the key fields during update .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason above link wasnt working. so updated link.
Eg:
"Feature control Implementation for Action
METHOD get_features.
"%control-<fieldname> specifies which fields are read from the entities
READ ENTITY zXXXX FROM VALUE #( FOR keyval IN keys
( %key = keyval-%key
%control-status = if_abap_behv=>mk-on
) )
RESULT DATA(lt_XXXX).
"Return that controls the feature %features-%action-<action name>
result = VALUE #( FOR ls_XXXX IN lt_XXXX
( %key = ls_asset-%key
%field-my_id = if_abap_behv=>fc-f-read_only
) ).
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use dynamic field control as shown below.
Then in create you will see at as editable and in update, it will be readonly.
-Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 7 | |
| 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.