‎2005 Aug 06 9:58 AM
There are three table it_a, it_b, It_c in the Sap DB, I have to keep the consistency of all the records. If theres an error occurs, which may be trigger by the program, or by the independency,
How can I realize it, Very thanks in advance..
‎2005 Aug 06 4:48 PM
Hi, F.J. Brandelik said is right, if you want to maintanence tables manually, the critical point is you should update the serveral tables in a LUW.
You'd better to lock the table, use the ENQUEUE_XXX and DEQUEUE_XXX.
And some FM is also helpful, TRANSACTION_BEGIN, TRANSACTION_END and other TRANSACTION_XXXX. You can write code between the BEGIN and END. They will be runned in a LUW.
‎2005 Aug 06 4:12 PM
Hi!
Best way to have consistent data: don't change any table independent of the others.
If you talk about standard tables, use only standard functions to add / change / delete data (like transactions, IDOC or BAPI).
If you design own tables, write a function module (or method in OO) which updates all three tables correctly. Then all updates have to be done with this function module.
Regards,
Christian
‎2005 Aug 06 4:16 PM
And make sure you do your updates in logical unit of work.
This allows you to either update all 3 or rollback if any of the 3 fails....
Enjoy
‎2005 Aug 06 4:48 PM
Hi, F.J. Brandelik said is right, if you want to maintanence tables manually, the critical point is you should update the serveral tables in a LUW.
You'd better to lock the table, use the ENQUEUE_XXX and DEQUEUE_XXX.
And some FM is also helpful, TRANSACTION_BEGIN, TRANSACTION_END and other TRANSACTION_XXXX. You can write code between the BEGIN and END. They will be runned in a LUW.
‎2005 Aug 08 4:18 AM
hello, zhenglin gu
I see your message, and it's helpful to me,
But to the FM TRANSACTION_BEGIN ETC. I can't find any document, may you kindly give me soem detailed information, or some samples, thanks very much.
‎2005 Aug 08 4:16 AM
hello, zhenglin gu
I see your message, and it's helpful to me,
But to the FM TRANSACTION_BEGIN ETC. I can't find any document, may you kindly give me soem detailed information, or some samples, thanks very much.
‎2005 Aug 08 4:54 AM
Hi, sorry for the slowly reply.
These FMs is actually start a LUW, launch it, or rollback it.
The usage of it is list as following:
1. Start with the FM TRANSACTION_BEGIN
2. write your code for table populate
3. if some error occur, call FM TRANSACTION_ABORT
4. when you ready to start the DataBase manipulate, call FM TRANSACTION_END
These are the mainly steps to use this mechanism.
Hope it will be helpful
In addition, about the sample code, you can reference to some BAPI, SAP using these FM in their standard BAPI, like BAPI_REQUISITION_CREATE.
Message was edited by: zhenglin gu
‎2005 Aug 08 9:03 AM