Hi Ravi,
BDC stands for Batch Data Communication, BDC allows you to perform database updates in the background.
Please take help of ABAPer.
Frequency of this program should be daily so system will calculate inactive users and lock them on daily basis. Better to schedule this at night when the load is minimum on system.
Hope this helps.
BR,
Mangesh