on 2025 Feb 18 11:11 AM
Hi Team,
I have a requirement to enable/disable input fields for input based on Create/Update/Delete action and other conditions in RAP application. How do we identify the current action that we are performing (Create/Delete/Update) in the method "get_instance_features". In core ABAP we do have a field TRTYP = H/V for this purpose. How do we do it in RAP model?
Regards,
Ram Peddireddi.
Request clarification before answering.
Hi @Ram_peddireddi You may want to try Global / Instance Authorisation that has the Actions user bring to perform.
For more details you may refer below Blog post...
https://community.sap.com/t5/technology-blogs-by-members/abap-rap-global-authorization/ba-p/13558291
* Check if EDIT operation is triggered or not
IF requested_authorizations-%update = if_abap_behv=>mk-on OR
requested_authorizations-%action-Edit = if_abap_behv=>mk-on.
*--> Your code goes here
ENDIF.
Hope this helps...
Thanks-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would select from the base CDS view to check whether the record already exists in the DB. If it does, you can say that current action is an update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try like below
field ( readonly : update ) fieldname;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.