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 giving Dump

Former Member
0 Likes
1,520

Hi,

I am using FM to send external mail in a user exit.For that i have to write a commit work otherwise mail is not sent to external user although sy-subrc = 0. I tried to use COMMIT WORK but it is giving me A DUMP

showing calling program is not committed. Is it ok to call commit in an exit or else what need to be done.

i tried using standard parameter of FM while commit but it is also giving me dump.

Send External Mail To Sales Associate{

code} CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = lf_doc_data

document_type = lf_doc

  • COMMIT_WORK = c_x

put_in_outbox = c_x

TABLES

object_content = lt_mailbody

receivers = lt_receiver_tab

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
947

COMMIT_WORK is already there(Imporn parameter in FM) but its an optional entry just use this.

no need to use explicit commit work after the FM.

Read only

Former Member
0 Likes
947

And in addition: keep it as a rule to avoid COMMIT in a user exit. You might trigger some nice nested commits or database inconsistencies.

Read only

0 Likes
947

Hi,

How to trigger nested COMMIT.

thnaks in advance

Read only

Former Member
0 Likes
947

commit work and wait.

is use to trigger nested commit

Read only

Former Member
0 Likes
947

Hi,

have a look into sap-note: 190669 (use: SO_DOCUMENT_SEND_API1 ...)

Regards, Dieter