Hello Kishore,
In the past I have handled similar requirement by developing the custom program to Lock and then to Unlock users.
Program used to be scheduled twice, once before start of the background job to inform users about BG job, kick off users from Planning Group out of APO and lock Planning Group. Later second scheduled run after BG Job to unlock the Planning Group.
You can check if Planning users logged in SAP system using FM TH_LONG_USR_INFO, if logged in send a Message using FM TH_POPUP, about BG job which would start in 'X' mins.
Delete Planning group users from SAP through FM TH_DELETE_USER
To Unlock Planning areas using FM '/SAPAPO/TS_DM_UNLOCK
Following tables will be useful while developing the code.
Table : /SAPAPO/TSAREAKO : Planning Area and Lock field details
Table : USGRP_USER : Assignment of Users to User Groups
Hope this will help.
Thank you,
Satish Waghmare