Auch dafür gibts wieder mal ein API:
Retrieve Record Locks (QDBRRCDL) API