Hi,
TRDIR is a standard SAP table, therefore it should already have a lock object.
What options are available on the SE11 initial screen that mention the word 'Lock' ??
Then do a search using TRDIR and that will tell you the available lock object. You then put the relevant function call in your program.
I hope you've only been writing reports so far and no programs that update data.....
Regards
Rich