cancel
Showing results for 
Search instead for 
Did you mean: 

How to lock users from accessing specific planning book

former_member215781
Active Participant
0 Kudos

Hi,

How to lock specific users say users presently in system to access specific planning area/planning book say ABC?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

You can write Z program which locks the planning area before batch job runs. The program is as follows Check the user using FM ENQUEUE_READ

Notify the user about planning area being locked and to log off

Update Z table with planning area and lock flag as X

If the user does not log off, kick out the user from the system using FM TH_DELETE_USER.

Then use the following FMs to Lock the planning area and unlock it.

/SAPAPO/TS_DM_LOCK

/SAPAPO/TS_DM_UNLOCK

Thanks

Amol

former_member215781
Active Participant
0 Kudos

I already have this Z program. But there is a bug with this concept. If the user is in transaction code already, and does not select any planning book/data view

1. He does not get recognized in ENQUEUE_READ and hence cannot be deleted/locked

2. The FM if used in report does not lock the user in this scenario

In this scenario, once the report runs to lock the planning book, the user sitting in transaction code already and can still acess the supposed-to-be-locled planning book in edit mode!

Hence I was looking for identifying all the users in the system and locking them from accessing the PB. Do we have FM or something to specify users to be locked when locking Planning Area?

former_member215781
Active Participant
0 Kudos

Contacted SAP. There is a variable in method 'DVIEW_DISPLAY_MODE_SET' which gets set to display mode/change mode when the user enters transaction code /SAPAPO/SDP94. This variable is not reset again based on the entry created in the Z table. There is no solution for this bug as of now.