2010 Mar 29 3:50 PM
hey
i'm saving to several tables with insert/update and i have know if the data saved consistently .
i know that not in abap it is possible to update with sections like :
BEGIN TRANSACTION.
INSERT / UPDATE ....
ENDTRANSACTION.
if the data didnt saved consistently i roleback .
is there something similar in abap beside catching the Return code every time ?
regards
asa
2010 Apr 17 9:13 AM
hey
i'm saving to several tables with insert/update and i have know if the data saved consistently .
i know that not in abap it is possible to update with sections like :
BEGIN TRANSACTION.
INSERT / UPDATE ....
ENDTRANSACTION.
if the data didnt saved consistently i roleback .
is there something similar in abap beside catching the Return code every time ?
regards
asa
2010 Mar 29 3:59 PM
Yes, you can. Explore below function modules
TRANSACTION_BEGIN
TRANSACTION_END
TRANSACTION_ABORT
2010 Mar 29 4:17 PM
thanks
did some searching but couldn't understand somethings :
is it a saved word or a function ?
if i'm updating few tables it will roleback all of them ?
BEGIN_TRANSACTION.
INSERT 1
INSERT2
INSERT 3 ?
ENDTRANSACTION.
what is the indicator for bad updating ? sy-subrc after every insert or is there any other options ?
best regards
asa
2010 Mar 29 8:27 PM
In SAP, this is called Logical Unit of Work (LUW). You either commit or rollback at the end: COMMIT WORK and ROLLBACK WORK. There are lots of concepts there, so please read the documentation (or attend a SAP training on database updates) and post another question if you don't understand something.
2010 Apr 16 9:47 AM
used set update task local at the pbo of the first screen and in when i'm saving i rather commit or rollback .
2010 Apr 16 10:16 AM
As your question was not precise, your feedback is useless (in fact it's no sense compared to the question, set update task local is not used for commit/rollback, though there is a relationship).
But anyway, thx for the effort of posting a feedback
2010 Apr 16 5:50 PM
Dear sandra ,
either advice or dont post at all ,
your comments not helping anyone .
best regards
ASA
2010 Apr 16 7:07 PM
I think Sandra's advice was good and although it might not help you, it may help those who come accross this thread with the same sort of question.
Rob
2010 Apr 16 8:56 PM
Hi ASA,
I apologize for my answer which was a little bit rude maybe. In fact, I didn't think that you could be interested in the details as you found a solution, so I didn't argument. It's why I wanted to warn other people who might look for answers, as Rob said. I could explain exactly what is set update task local, what is commit work, rollback work, etc., if you want more information, don't hesitate to ask me.
sandra
PS: thx Rob
2010 Apr 17 9:12 AM
hey sandra ,
as a matter of fact im interested to know how did you suggest to solve the problem .
how can i ensure data consistnecy in my program ?
regards
ASA
2010 Apr 17 9:13 AM
2010 Apr 17 11:45 AM
I already answered to you in my first answer. If you don't ask a more precise question, we can't help because forum goal is not to answer basic questions.
As I am a nice person, I give you an overview:
That's a simple and complex topic, and you have to be trained (read the documentation as I said, forum is not here to repeat the documentation).
In short, you have to do the updates at the latest moment (when user saves, after the checks have been done), and you end them with COMMIT WORK (that calls update function modules, see below, then issues a database commit). If a dump occurs at any time, SAP automatically issues a ROLLBACK WORK that undo all updates done since the previous COMMIT. You may issue it programmatically if you need to handle errors between updates.
If you have lots of updates or can't do it at the latest moment, you update database using the update task: you create function modules by setting the "update" flag in the properties tab, and you call them using CALL FUNCTION ... IN UPDATE TASK.
Some abap statements issue implicitly a database commit, so you must not use them between updates. Here are these statements: [Database Commit|http://sandraros.free.fr/abap_docu.htm?url=ABENDB_COMMIT.htm]
And here is [COMMIT WORK documentation|http://sandraros.free.fr/abap_docu.htm?url=ABAPCOMMIT.htm]
There are lots of other concepts, you understand that I can't explain here, so refer to the doc, or attend a training.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |