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

Commit work statement going dump

0 Likes
2,428


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

6 REPLIES 6
Read only

ramakrishnappa
Active Contributor
0 Likes
1,541

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

Read only

0 Likes
1,541

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


Read only

0 Likes
1,541

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

Read only

ramakrishnappa
Active Contributor
1,541

Hi Vijay,

Is your issue resolved?

Read only

0 Likes
1,541

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

Read only

0 Likes
1,541

Thats good to hear