SAPфорум.RU
https://www.sapboard.ru/forum/

BAPI_TRANSACTION_ROLLBACK после BAPI_MATERIAL_MAINTAINDATA_RT
https://www.sapboard.ru/forum/viewtopic.php?f=13&t=97656
Страница 1 из 1

Автор:  ded_morozov_krg [ Вт, июн 04 2019, 07:04 ]
Заголовок сообщения:  BAPI_TRANSACTION_ROLLBACK после BAPI_MATERIAL_MAINTAINDATA_RT

Такая ситуация: часто использую BAPI_MATERIAL_MAINTAINDATA_RT, в случае return-type = 'S' делаешь CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' и все хорошо.
Но в случае когда return-type = 'X', 'A', 'E', нужно сделать rollback, но при этом затираются данные, о произошедших ошибках, которые потом можно посмотреть в журнале приложения SLG1.
Возможно ли и сделать Rollback и сохранить журнал?

Автор:  LKU [ Вт, июн 04 2019, 08:49 ]
Заголовок сообщения:  Re: BAPI_TRANSACTION_ROLLBACK после BAPI_MATERIAL_MAINTAINDATA_RT

Посмотрите вот эту тему: viewtopic.php?f=13&t=91536
Возможно поможет.

Автор:  ded_morozov_krg [ Ср, июн 05 2019, 07:53 ]
Заголовок сообщения:  Re: BAPI_TRANSACTION_ROLLBACK после BAPI_MATERIAL_MAINTAINDATA_RT

Разобрался, стоило документацию почитать :D :D :D
В общем для этой BAPI rollback в принципе не нужен, она сама контролирует целостность данных, и зароллбечит то, что ей нужно, поэтому commit влияет только как раз таки на месседжи)

Автор:  Besa [ Пн, июн 10 2019, 10:19 ]
Заголовок сообщения:  Re: BAPI_TRANSACTION_ROLLBACK после BAPI_MATERIAL_MAINTAINDATA_RT

Просто дополню тему выдержкой из документации

Цитата:
The data transferred is updated synchronously; that is, not using an update task. This is necessary because this method is also used in distribution by Application Link Enabling (ALE), where asynchronous updating cannot be supported in inbound processing because the processing status of the assigned IDocs cannot otherwise be set reliably.

If a serious database error occurs during synchronous updating of the application data, a rollback for all database changes made so far is triggered in the method. If the method is called in a commit unit together with other methods, the database changes of the previously executed method calls are also rolled back as a result. The rollback is necessary to prevent database inconsistencies due to only part of the application data being updated correctly.

Any information or error messages that are issued while the data is being processed are recorded in the application log. If you want to view these messages, a commit must be performed after this method is called so that the data in the application log is written to the database. Even if the structure RETURN returns an E-type (error) message in field TYPE, a commit must be performed so that the application log is written. In the event of an error, the method itself ensures that the data is reset correctly. The commit is also necessary to trigger the updating of the classification data because the update module for the classification data is registered by means of PERFORM ON COMMIT and is started only by a COMMIT WORK.

Страница 1 из 1 Часовой пояс: UTC + 3 часа
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/