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
alex_nil
Участник
Участник



Joined: 26 Sep 2007
Posts: 25

PostPosted: Thu Nov 22, 2007 10:19 am    Post subject: Как проверить, что транзакция выполнилась успешно? Reply with quote

Запускаю транзакцию me22n через CALL TRANSACTION, под отладчиком возращается ошибка sy-subrc = 1. Но транзакция нормально выполнилась. Как можно проверить успешность ее выполнения?
Back to top
View user's profile Send private message
july7
Старший специалист
Старший специалист



Joined: 10 Oct 2007
Posts: 109
Location: Киров

PostPosted: Thu Nov 22, 2007 10:45 am    Post subject: Reply with quote

Нужно проанализировать возвращаемые сообщения в таблице it_MESSTAB, если нет сообщений типа 'E', значит сохранить изменения удалось:

Code:
  CALL TRANSACTION TCODE USING it_BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO it_MESSTAB.
Back to top
View user's profile Send private message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sun Dec 02, 2007 2:29 pm    Post subject: Reply with quote

Наткнулся

Rich wrote:
SAP returns a 0 subrc if the transaction completes without error, however, if some of the data is incorrect, (ie material not found, profit centre not found etc), or the transaction comes across a data lock, SAP normally displays a warning message which allows the user to correct the problem and then continue.

In a BDC this action is not possible and the BDC terminates.

At this point you will possibly have a subrc of 1001 (you will more likely have a subrc of 0) and a warning in your BDC collector.

Taking the data lock, this message has a different message number for each transaction; Same messages in different transactions do not have the same message number. Therefore you cannot look for this message number in your BDCMSGCOLL table using an Error message class (E or A).

I've taken the approach of using a small table which contains warning messages that I've come across that I wish to treat as errors. I scan my message table on the way out of my Call BDC routines and change the message type there if I find a match, Then all I need to look for are E class messages without having to make the procedure transaction specific.

I've used this approach since 3.0 and it's always worked without having to worry about subrcs being 0 or 1001, or what message means what and should I treat it as an error...

regards

Rich
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 -> 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.