‎2014 Jan 08 1:18 PM
Hi Experts,
I am using commit work after function module /RPM/FIN_PLAN_SAVE_DB it is going to dump.Because before commiting i am doing one change on screen and not saving that screen.So dailog commit and database commit trying to commit same time and trying dump.
But my client requirement is capture the dump and replace dump with one error message.Is it possible to stop dump and raising error message in that place?
Urgent please guide me.
Thanks & Regards
vijay
‎2014 Jan 08 1:33 PM
Hi Vijay,.
Yes, you can avoid short dump by using TRY statement.
DATA lx_root type ref to cx_root.
TRY.
......................."WRITE YOUR CODE HERE
CATCH cx_root into lx_root.
" cx root catches all exceptions and you can get the text of error message
lx_root->get_text( ).
"You can also prepare your custom message here
ENDTRY.
Hope this helps you.
Regards,
Rama
‎2014 Jan 09 10:54 AM
Hi Ram,
I tried to capture short dump for commit work.
data:lx_root type ref to cx_root.
DATA lv_message TYPE string.
DATA lv_message1 TYPE REF TO if_wd_message_manager.
CALL FUNCTION '/RPM/FIN_PLAN_SAVE_DB'
EXPORTING
it_delete = t_fin_plan1
it_insert = t_fin_plan.
IF sy-subrc = 0 AND t_fin_plan[] IS NOT INITIAL.
TRY .
COMMIT WORK.
CATCH cx_root into lx_root.
lv_message = lx_root->get_text( ).
ENDTRY.
in above code after COMMIT WORK statement it is throwing short dump.
Please suggest me.
Thanks & Regards
vijay
‎2014 Jan 09 3:01 PM
Hi Vijay,
I suspect, that the issue is with FUNCTION MODULE. as there are no exceptions are caught.
Please check if FM has exceptions, if so.. please catch exceptions.
could you place the FM inside TRY & ENDTRY as below
TRY.
CALL FUNCTION '/RPM/FIN_PLAN_SAVE_DB'
EXPORTING
it_delete = t_fin_plan1
it_insert = t_fin_plan.
IF sy-subrc = 0 AND t_fin_plan[] IS NOT INITIAL.
COMMIT WORK.
ENDIF.
CATCH CX_ROOT INTO LX_ROOT.
lv_message = lx_root->get_text( ).
ENDTRY.
Hope this resolves your issue.
Regards,
Rama
‎2014 Jan 15 2:23 AM
‎2014 Jan 16 7:47 AM
Hi Ram,
Issue is solved..
Finally i removed commit statement in current method and used standard save button then it automatically savings data in database.
Thanks for your support Ram.
Regards
vijay
‎2014 Jan 16 7:49 AM