03-31-2009 8:08 AM
Hi guys,
I have two questons please:
1. Do I need to do commit/rollback after I insert/update record in internal table? does this depends on loop...endloop
2. Do I need to do commit/rollback after I insert/update record from abap into remote oracle db?
Thanks,
Nihad
03-31-2009 8:14 AM
Hi;
suppose you are updating a table and if you
comit it then the document is updated in the database.
ROOL BACK: If suppose some error occured during updation
and you have not commited then the entire ata is not
updated in the table and that is known as roll back.
For details, have a look
[Link|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/content.htm]
Regards
Shashi
03-31-2009 8:14 AM
Hi;
suppose you are updating a table and if you
comit it then the document is updated in the database.
ROOL BACK: If suppose some error occured during updation
and you have not commited then the entire ata is not
updated in the table and that is known as roll back.
For details, have a look
[Link|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/content.htm]
Regards
Shashi
03-31-2009 8:17 AM
Hi,
You need not do any commit or rollback in internal tables... as its not affecting the data base tables....
but when you are updating the database tables let it be oracle DB or any other that time its mandatory to write commit or rollback depending on the situation...
Regards,
Siddarth
03-31-2009 8:23 AM
Hi,
1. Do I need to do commit/rollback after I insert/update record in internal table? does this depends on loop...endloop
The puropse of Internal table is only for temporary storage.There is no need for commit/rollback in this case.
2. Do I need to do commit/rollback after I insert/update record from abap into remote oracle db?
I case of database table you have to commit for update or rollback if no need.
Thanks,
Karthik
03-31-2009 8:28 AM
03-31-2009 8:39 AM
Thanks for answers,
I mean when insert or update in custom z table (not internal temporary, I said wrong). This table will be storage table..,so I need to do it right?
is this enough after insert line? how to add some message to this, if insert is not sucessful?
IF SY-SUBRC = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.
Thanks,
Nihad
03-31-2009 8:56 AM
Hi ,
Commit will save the updates into ur database.
But Rollback will do the undo from the point whare it is not ommited.
Note: oNce commit u canot rollback that,