Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function in DataWarehouse and ROLLBACK WORK

Former Member
0 Likes
1,186

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,139

Hi,

dont pass values i_db_commit and i_commit_work parameters in FM

Read only

0 Likes
1,139

i marked (took away) i_db_commit and i_commit_work in FM, but rollback doesn't work (the changes are still there).)

Read only

0 Likes
1,139

Are you trying with same set of test data..?

Nabheet

Read only

0 Likes
1,139

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

Read only

0 Likes
1,139

one note - maybe "problem" with type of FM - > Processing type = "Remote-enabled Module"

Read only

matt
Active Contributor
0 Likes
1,139

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.

Read only

0 Likes
1,139

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

Read only

0 Likes
1,139

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.

Read only

matt
Active Contributor
0 Likes
1,139

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.

Read only

0 Likes
1,139

Please, could you give me info about this setting ( dirty database writes ) ?

Where can i check ( set ) it ?

Thanks in advance

Martin

Read only

matt
Active Contributor
0 Likes
1,139

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