If you want to check a row for locks before doing anything the easiest way is to try to lock it with NOWAIT.
You will get an Oracle error if it is locked by another process and you can handle the exception and do what you like.
IFS does that in the framework in method Lock_By_Keys_Nowait___ if you want to investigate.
Below is an example of a method I created from LU ReturnMaterial which locks the record if possible and returns ‘TRUE’ if lock is successful and ‘FALSE’ if not. This is a quick copy from Lock_By_Keys_Nowait___ which I modified so it can be improved. For example it requires the record to exist but that you might already know.
FUNCTION C_Lock_By_Keys_Nowait (
rma_no_ IN NUMBER) RETURN VARCHAR2
IS
row_locked EXCEPTION;
PRAGMA EXCEPTION_INIT(row_locked, -0054);
dummy_ NUMBER;
BEGIN
SELECT 1
INTO dummy_
FROM return_material_tab
WHERE rma_no = rma_no_
FOR UPDATE NOWAIT;
RETURN 'TRUE';
EXCEPTION
WHEN row_locked THEN
RETURN 'FALSE';
END C_Lock_By_Keys_Nowait;