2005 Aug 01 3:40 PM
hey can any one tell me how can i lock the Z Report, means i have mad report on MSEG and MKPF table, i want that if one user is processing that report at the same time other user shud not be able to process the same report, i hope i have cleared my query.
abhishek
Lock/Unlock the ABAP Editor Lock Field
REPORT ZEDITOR.
TABLES: TRDIR. "System table TRDIR
PARAMETERS: PROGRAM LIKE TRDIR-NAME.
PARAMETERS: EDITOR LIKE TRDIR-EDTX.
SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.
TRDIR-EDTX = EDITOR.
MODIFY TRDIR.
IF SY-SUBRC EQ 0.
WRITE: / 'Editor Lock update Successful ', TRDIR-NAME.
IF TRDIR-EDTX = 'X'.
WRITE: ' Lock'.
ELSE.
WRITE: ' UnLock'.
ENDIF.
ELSE.
WRITE: / 'Editor Lock update Unsuccessful ', TRDIR-NAME.
ENDIF.
2005 Aug 01 3:49 PM
Hi Abhishek,
The following code will help you.
Regards,
Suvan
REPORT ZPROGRAM.
************************************************************************
*******
Prevent the program from having more than one instance running the
*same time.
Create this macro in TRMAC using SM31
Insert the following single line in the program right after the
REPORT statement: ZCHK_MYSELF_RUNNING SY-REPID.
************************************************************************
*******
define my_macro.
DATA: PRG LIKE INDX-SRTFD.
PRG = &1.
CALL FUNCTION 'ENQUEUE_ESINDX'
EXPORTING
*RELID = 'ZZ'
SRTFD = PRG
*SRTF2 = 0
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2.
IF SY-SUBRC NE 0.
WRITE: 'ERROR:', PRG, 'is already running'.
EXIT.
ENDIF.
end-of-definition.
my_macro 'ZPROGRAM'.
*******
Note that the program name is 'ZPROGRAM'.
2005 Aug 26 7:45 AM
Hi Abhishek
Please check the following link:
https://www.sdn.sap.com/sdn/collaboration.sdn?node=linkFnode6-1&contenttype=url&content=https://
Regards
Ashish
2005 Aug 26 7:59 AM
2005 Aug 26 7:59 AM
Lock/Unlock the ABAP Editor Lock Field
REPORT ZEDITOR.
TABLES: TRDIR. "System table TRDIR
PARAMETERS: PROGRAM LIKE TRDIR-NAME.
PARAMETERS: EDITOR LIKE TRDIR-EDTX.
SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.
TRDIR-EDTX = EDITOR.
MODIFY TRDIR.
IF SY-SUBRC EQ 0.
WRITE: / 'Editor Lock update Successful ', TRDIR-NAME.
IF TRDIR-EDTX = 'X'.
WRITE: ' Lock'.
ELSE.
WRITE: ' UnLock'.
ENDIF.
ELSE.
WRITE: / 'Editor Lock update Unsuccessful ', TRDIR-NAME.
ENDIF.
2005 Aug 26 8:21 AM
Hi Judith,
This is editor lock that you are talking about here. Point in question is different. This will prevent other people from modifying the program whereas the point of discussion is how to prevent two user from simultaneously running the same program. This has been discussed several times on this forum and some of the solutions/links given above are valid.
Cheers,
Sanjeev
2005 Aug 26 12:04 PM
ENQUEUE AND DEQUEUE FM's are related to locking concept.
Goto se37 enter these and press F4. you will get list of FM's. To see how a particular FM can be used , press 'WHERE USED LIST' button
just a tip not detail.try above suggestions.
regards
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |