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

Как определить, что транзакция запущена в режиме изменения



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Лазарев
Участник
Участник



Joined: 26 Sep 2007
Posts: 22

PostPosted: Wed Dec 19, 2007 4:59 pm    Post subject: Как определить, что транзакция запущена в режиме изменения Reply with quote

Добрый день!
Мне нужно знать, что транзакция не запущена каким-нибудь пользователем в режиме изменения. Например, va02 cо сбытовым ордером 1234. Существует ли како-нибудь FM?
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Dec 19, 2007 5:11 pm    Post subject: Reply with quote

Можно попробывать вызвать ФМ SD_SALES_DOCUMENT_ENQUEUE с номером сбытового заказа - если кто-то уже обрабатывает придет ексепшн FOREIGN_LOCK. Ну а если нет - не забудьте перед обработкой сделать unlock.
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 150
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Dec 19, 2007 10:06 pm    Post subject: Reply with quote

Присоединяюсь к John Doe.

Еще варианты:

Rich Heilman wrote:
You might want to try using the fucntion module ENQUEUE_READ or you could use the lock object for sales documents, the function module to try to lock is ENQUEUE_EVVBAKE. You could call this and if there is a lock, it will tell you, if there is not a lock, you can quickly release the lock which as just created by the ENQUEUE_EVVBAKE function module and then call your BAPI.

Regards,
Rich Heilman


Quote:
You can use the FM ENQUEUE_READ function module..
Give the user name..
In the parameter
GUNAME - GIve the user ID.
GNAME - VBAK
In the ENQ internal table you will have a list of sales orders that the user is using in VA02.

Code:

DATA: GARG LIKE SEQG3-GARG,
          ENQ LIKE SEQG3 OCCURS 1 WITH HEADER LINE.
 
REFRESH ENQ.
CONCATENATE sy-mandt vbeln INTO GARG.

CALL FUNCTION 'ENQUEUE_READ'
       EXPORTING
            GCLIENT               = SY-MANDT
            GNAME                 = 'VBAK'
            GARG                  = GARG
            GUNAME                = SPACE
       TABLES
            ENQ                   = ENQ
       EXCEPTIONS
            COMMUNICATION_FAILURE = 1
            SYSTEM_FAILURE        = 2
            OTHERS                = 3.
READ TABLE ENQ INDEX 1.
IF SY-SUBRC = 0.
  MESSAGE S042(V1) WITH vbeln RAISING ERROR_IN_COPY.
ENDIF.


Quote:
For this you need to create Lock Object from se11 .It will automatically create Two Function modules for enque and deque.
In you case If you want to see the Details for VA02 use.

Code:

CALL FUNCTION 'ENQUEUE_EVVBAKE'
  EXPORTING
    VBELN = VBELN "Sales order
  EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2.
CASE SY-SUBRC.
WHEN 1.
  MESSAGE E042(V1) WITH vbeln RAISING ERROR_IN_COPY.
ENDCASE.
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP 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.