Posts

Showing posts from July, 2025

Validations in RAP using Unmanaged scenario.

Image
Validations are used to check the consistency and correctness of the data before it is saved to the database.  If the data is invalid, appropriate error messages are returned to the user. Managed Scenario In Managed Scenario, the final check for all involved BOs is done via validations. In Managed Scenario VALIDATIONS are called during CHECK_BEFORE_SAVE method. Unmanaged Scenario In unmanaged Scenario, the final check for all involved BOs is done in CHECK_BEFORE_SAVE method. FAILED REPORTED CHECK_BEFORE_SAVE method gets called during the SAVE sequence. If the method returns an error in the failed parameter, the save sequence is terminated and the CLEANUP_FINALIZE method is called.                                   Refer:-   Etag in RAP Unmanaged Step 1:   Change the API class and change the student internal table to public. CLASS zcl_ab_stuh_13 DEFINITION ...

Etag in RAP Unmanaged

Image
  In RAP , ETag is used for optimistic concurrency control . It prevents data overwrite when two users attempt to update the same record. It relies on the If-Match HTTP header sent by the UI (e.g. Fiori Elements). The backend compares the current DB version with the ETag (like last_changed_at ) sent by the client. If they don't match, raise a concurrency error .                                   Refer:-   Lock object in Unmanaged scenario in RAP Step 1:   Check the fields in table level (Already maintained- Header).               * In this blog I used last_ch_date as Created date and last_ch_time as Last changed date. Step 2:   Add the fields in interface view entity- like below (Header). @AbapCatalog.viewEnhancementCategory: [#NONE] @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Interf...