cancel
Showing results for 
Search instead for 
Did you mean: 

Lock Planning book before batch job run

former_member215781
Active Participant
0 Kudos

I have a 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

If the user is already in the transaction code /SAPAPO/SDP94 and does not select any planning book or data view, he does not get recognized in FM ENQUEUE_READ and hence he is not notified about planning book going to be locked.

After the above locking program is run, and the user then selects the supposed to be locked planning book, he can access it and edit it! If he restarts the transaction again with /n i.e re-enters the planning book, then he founds the planning book locked.

I tried using FM /SAPAPO/MSDP_DATA_LOCK and it works fine when used independently. If I am inside the transaction code without selecting anything and I run the FM, and then try to access the locked PB it gives me an error of 'Locled by user XXXXX'. But when I try to use this FM in any report, it does not behave the same!! The behaviour is same as my previous program. Alternatively I also tried FM ENQUEUE_/SAPAPO/E_PAREA but no success.

Does anyone have the solution to this? Or any inputs is appreciable. Also, can I contact SAP regarding this planning book locking problem.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

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.

Former Member
0 Kudos

Hello Sim,

Did you fix this problem? We also need to do the Planing area locking mechanism. We have custom programs to notify and log off users, Can you pl share your exp on how to lock PA while job is executing.

your help is highly apprecated

Aravind