Get Example source ABAP code based on a different SAP table
SAP Locks, Set and Release This example demonstrates how SAP locks are set and released (enqueue and dequeued).
ABAP_SOURCE_CODE ABAP_EXEC >
ABAP_DESCRIPTION The function codes ENQUEUE> and DEQUEUE> of the GUI status can be used to lock and unlock the specified fields of the table SFLIGHT>. This is done using the lock object EDEMOFLHT> is used using the corresponding function modules ENQUEUE_EDEMOFLHT>> and DEQUEUE_EDEMOFLHT>>. The return code sy-subrc> and the system fields for messages> are preserved in dedicated structures. These contain important information returned by the function modules and can be used for analyzing lock problems. Furthermore, the function code SELECT> enables the specified fields to be accessed and the function code SM12> calls the transaction SM12> to display the lock entries in the central lock table. Once the data records have been locked by a user, no other user can lock the same records again. All users can, however, access the locked data records using AB-SQL statements, assuming the program did not already check the locks using ENQUEUE_EDEMOFLHT>.