SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Prevents runnig more than one instance the same time



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 18, 2007 8:23 pm    Post subject: Prevents runnig more than one instance the same time Reply with quote

Simple macro that prevents runnig more than one instance of the same ABAP the same time

Code:
ZCHK_MYSELF_RUNNING  000      *Prevent the program from having more   
ZCHK_MYSELF_RUNNING  001      *the one instance running the same time.
ZCHK_MYSELF_RUNNING  002      *Create this macro in TRMAC using SM31 
ZCHK_MYSELF_RUNNING  003      *Insert the following single line in the
ZCHK_MYSELF_RUNNING  004      *program right after the REPORT state- 
ZCHK_MYSELF_RUNNING  005      *ment:   ZCHK_MYSELF_RUNNING SY-REPID. 
ZCHK_MYSELF_RUNNING  010      DATA: PRG LIKE INDX-SRTFD. PRG = &1     
ZCHK_MYSELF_RUNNING  011      CALL FUNCTION 'ENQUEUE_ESINDX'         *
ZCHK_MYSELF_RUNNING  012           EXPORTING RELID = 'ZZ'            *
ZCHK_MYSELF_RUNNING  013                SRTFD = PRG                  *
ZCHK_MYSELF_RUNNING  014                SRTF2 = 0                    *
ZCHK_MYSELF_RUNNING  015           EXCEPTIONS FOREIGN_LOCK = 1       *
ZCHK_MYSELF_RUNNING  016                SYSTEM_FAILURE = 2           
ZCHK_MYSELF_RUNNING  017      IF SY-SUBRC NE 0                       
ZCHK_MYSELF_RUNNING  018      WRITE: 'ERROR:',PRG,'is already running'
ZCHK_MYSELF_RUNNING  019      EXIT. ENDIF                             
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.