‎2010 Aug 23 11:24 AM
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?
‎2010 Aug 23 11:39 AM
‎2010 Aug 23 11:48 AM
‎2010 Aug 23 11:55 AM
So you have written custom function module for processing of your idoc?
‎2010 Aug 23 12:02 PM
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.
‎2010 Aug 23 12:43 PM
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
‎2010 Aug 23 12:47 PM
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]