‎2012 Jan 18 11:39 AM
Hi experts,
i don't have experience with commit and rollback in ABAP.
I would like to "return" all rows which were inserted by using FM below.
for my testing i put command ROLLBACK WORK at the end, but the rows were inserted into the table. ROLLBACK "doesn't work".
What should i change ?
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = lc_iobjnm
I_UPDATE_ALL_ATTRIBUTES =
i_clear_unmapped_attributes = rs_c_false
i_chavl_enqueue = rs_c_true
i_db_commit = rs_c_true
i_commit_work = rs_c_true
i_no_appl_logging = rs_c_false
IMPORTING
e_subrc = l_subrc
TABLES
I_T_ATTRIBUTES =
i_t_data = lt_masterdata
e_t_messages = lt_messages.
ROLLBACK WORK.
Thanks in advance
Martin
‎2012 Jan 18 11:46 AM
Hi,
dont pass values i_db_commit and i_commit_work parameters in FM
‎2012 Jan 18 11:52 AM
i marked (took away) i_db_commit and i_commit_work in FM, but rollback doesn't work (the changes are still there).)
‎2012 Jan 18 11:54 AM
‎2012 Jan 18 12:02 PM
i have the same test data, before running i deleted master data in the table /BIC/SZQRY_PROF, after that i run report and rows were inserted, rollback doesn't work
‎2012 Jan 18 12:10 PM
one note - maybe "problem" with type of FM - > Processing type = "Remote-enabled Module"
‎2012 Jan 18 12:50 PM
ROLLBACK WORK is an integral part of ABAP. If it didn't work, I think it would be noticed by more than just you.
Rollback absolutely does work with this function module, if you have correctly specified the parameters. (Or omitted them, as they default to "false". ) Your problem must lie elsewhere. Either you're doing the test incorrectly, forgetting to activate the master data, or a commit work is being preformed somewhere else in your program.
Deleting the SIDs directly from the table is a bad idea. The fact that the FM is RFC enabled is irrelevant.
Edit: some databases do dirty writes - i.e. they update the table anyway. What database are you connected to.
‎2012 Jan 18 1:10 PM
i delete data from "my IO" correctly - > by using "delete master data" in menu ( not directly over table ), after that is SID table empty
for new data i am using code below ( without activate master data), after that i see data in SID table, rollback doesn't work
lc_iobjnm = 'ZQRY_PROF'.
lt_masterdata-record_no = 1.
lt_masterdata-iobjnm = lc_iobjnm.
lt_masterdata-VALUE = 'XYZ'.
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = lc_iobjnm
i_clear_unmapped_attributes = rs_c_false
i_chavl_enqueue = rs_c_true
i_db_commit = rs_c_true
i_commit_work = rs_c_true
i_no_appl_logging = rs_c_false
IMPORTING
e_subrc = l_subrc
TABLES
i_t_data = lt_masterdata
e_t_messages = lt_messages.
ROLLBACK WORK.
database = oracle
‎2012 Jan 18 1:20 PM
The result is the same - > rollback doesn't work
insert master data - > long name of the profile - > ZQRY_"USER"_"QUERY"
CALL FUNCTION 'RSNDI_MD_ATTRIBUTES_UPDATE'
EXPORTING
i_iobjnm = lc_iobjnm
i_clear_unmapped_attributes = rs_c_false
i_chavl_enqueue = rs_c_true
i_db_commit = rs_c_true
i_commit_work = rs_c_true
i_no_appl_logging = rs_c_false
IMPORTING
e_subrc = l_subrc
TABLES
I_T_ATTRIBUTES =
i_t_data = lt_masterdata
e_t_messages = lt_messages.
ROLLBACK WORK.
‎2012 Jan 19 10:12 AM
We use this FM successfully, hence my puzzlement at the issue you are facing. So long as you are commenting out
i_db_commit = rs_c_true
i_commit_work = rs_c_true
Then ROLLBACK should be working. If it isn't then you must have a serious problem with your system. and you need to raise a support call with SAP. The only explanation I have is that your system is doing dirty database writes.
‎2012 Jan 19 10:27 AM
Please, could you give me info about this setting ( dirty database writes ) ?
Where can i check ( set ) it ?
Thanks in advance
Martin
‎2012 Jan 19 11:33 AM
The documentation is here: http://help.sap.com/abapdocu_70/en/ABENDB_LOCK.htm
Effectively it's a matter of calling DB_SET_ISOLATION_LEVEL.
Regards
matt