What is your for each meant to be doing? Is it a report or some query that needs to update your data?
If your for each is meant to do something that does not update your database contents (including deleting records), use the NO-LOCK option on your for each and you should be laughing. For instance:
Code:
FOR EACH <TableName> NO-LOCK
WHERE <WhereClause>:
DISPLAY <TableName>.<FieldName1> <TableName>.<FieldName2>.
END.
The above will run through the records and display them, even the locked ones. If your for each is meant to update the database contents things get a lot trickier. Especially because you will have to ask yourself about the "what if". If your query updates the database and you make it skip locked records you may end up with a stack of bad data in your db, which I doubt you will want to happen.
Now, if you want to get deep into stuff and depending on your Progress version, you may also be able to tap into the hidden tables of your database and read the lock table. This allows you to see what records are locked and even which user has applied the lock. Let me know if you need an example of how to do that (I will have to dig into some of my code).
HTH