on 10-04-2010 4:29 PM
Hi,
I need to lock planning area. I used the FM /SAPAPO/TS_LC_LOCK. It works fine but when I come out of the program all the locks are released. Actually this is the standard behaviour of Enqueue functionality.
Tried this FM also - /SAPAPO/TS_DM_LOCK but of no use.
As per my requirement I need to Lock the Planning area and then run all the Jobs and then Unlock the planning area. Please help to achieve this functionality. In short I need to Loack the planning areas until I unlock them explicitly.
Thanks!
Hi,
Try these function modules separately ...
To lock planning area *******
CALL FUNCTION 'ENQUEUE_/SAPAPO/E_PAREA'
EXPORTING
MODE_/SAPAPO/DM_PAREA_LOCK = 'S'
PAREA = PL_AREA
IOBJNM =
SELECTION =
X_PAREA = ' '
X_IOBJNM = ' '
X_SELECTION = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE 'Planning area not locked' TYPE 'E' .
ELSE .
MESSAGE 'Planning area locked successfully' TYPE 'I' .
ENDIF.
******************************************************************************************
To unlock planning area *******
CALL FUNCTION 'DEQUEUE_/SAPAPO/E_PAREA'
EXPORTING
MODE_/SAPAPO/DM_PAREA_LOCK = 'S'
PAREA = PL_AREA
IOBJNM =
SELECTION =
X_PAREA = ' '
X_IOBJNM = ' '
X_SELECTION = ' '
_SCOPE = '3'
_SYNCHRON = ' '
_COLLECT = ' '
.
IF sy-subrc <> 0.
MESSAGE 'Planning area not unlocked' TYPE 'E' .
ELSE .
MESSAGE 'Planning area unlocked successfully' TYPE 'I' .
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using LOCK and UNLOCK function in one single programe?
Rgds SB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your requirement is a little conflicting here. If you lock your PA using a program, and then run your jobs on the same PA, the jobs will fail. So I am not clear what you are trying to achieve through this exercise.
Thanks
Mani Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.