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

Dump on rollback work

Former Member
0 Likes
1,170

Hi guys

i am working on database updation, but i am getting dump on ROLLBACK WORK. i tried to handel it using TRY and ENDTRY

sample code ....

text type string.

oref TYPE REF TO cx_root

TRY.

ROLLBACK WORK.

CATCH cx_root INTO oref.

text = oref->get_text( ).

ENDTRY.

IF NOT text IS INITIAL.

WRITE / text.

ENDIF.

but still its getting dump on ROLLBACK , why catch method is not executing?

6 REPLIES 6
Read only

Former Member
0 Likes
873

Are you doing this within some exits for something?

Read only

0 Likes
873

no i am creating Idoc and moving Idoc no to database.

Read only

Former Member
0 Likes
873

So you have written custom function module for processing of your idoc?

Read only

0 Likes
873

yes i have written Custom Fm , its fetching exting record and adding idoc no to same record.

do we need to lock table while performing update, modify stmnt.

Read only

0 Likes
873

Hi,

yes we have to lock the table before modifiying and then modify it and unlock the table..

follow the sample code..

Lock the table

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

mode_rstable = 'E'

tabname = p_table

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3. IF sy-subrc = 0.* Modify the database table with these changes

MODIFY (p_table) FROM TABLE <dyn_tab_temp>. REFRESH <dyn_tab_temp>.* " here you have perform modify operation

Unlock the table

CALL FUNCTION 'DEQUEUE_E_TABLE'

EXPORTING

mode_rstable = 'E'

tabname = p_table. ENDIF.

hope this will help you..

Regards,

Kiran

Read only

ThomasZloch
Active Contributor
0 Likes
873

Instead of catching the exception, you should rather avoid it. What exactly does the short dump tell you? Did you go to ST22 at all and analyse what might be the cause, before asking here? The rollback itself should normally not occur, what went wrong beforehand?

Please include all relevant information in your next post to keep people from guessing.

Thomas

[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]