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

SO_DOCUMENT_SEND_API1

stefan_hntemann
Explorer
0 Likes
801

Hi all,

I use a report with a perform SEND. In this perform i use the FM SO_DOCUMENT_SEND_API1. This works, the email is send.

Now i want to call this perform from another Report (external perform) or rather from the HR-table t588z with Action 'F'.

The message 'Mail was sent occurs, but there is no item in TA SCOT and no mail is going out.

Has anyone experience ?

Thanks

Stefan

6 REPLIES 6
Read only

former_member194669
Active Contributor
0 Likes
774

Have import parameter


commit_work   = 'X'

in the function module call?

a®

Read only

0 Likes
774

Hi a®s,

see coding below:

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = document_data

put_in_outbox = 'X'

commit_work = 'X'

IMPORTING

sent_to_all = sent_to_all

TABLES

packing_list = packing_list

contents_txt = contents_txt

  • contents_hex = contents_hex

receivers = receivers

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.

CASE sy-subrc.

WHEN '0'.

COMMIT WORK.

MESSAGE i000(zhr) WITH 'Mail wurde gesendet !'.

WHEN OTHERS.

ENDCASE.

Read only

Former Member
0 Likes
774

Hi,

I doubt SAP will not allow the commit work in the same session while triggering the dynamic actions may be we need to submit the program containing the form so that this opens a seperate session....and performs the function as well

@ARS Sir:

please correct me if i was wrong as i had faced this problem when

i used HR infotype operation which hasn't allowed me to commit or rather helped me only when i wrote a submit..

Cheers,

Jacks

Read only

0 Likes
774

Stefan,

Try to change the function module call with an addition CALL FUNCTION func STARTING NEW TASK task . But i am not 100% sure about this.

After reading this documentation about dynamic actions

http://it.toolbox.com/wiki/index.php/Dynamic_Action

May be this will help you out,

a®

Read only

0 Likes
774

Thanks to all,

it works with

CALL FUNCTION func STARTING NEW TASK task.

Stefan

Read only

Former Member
0 Likes
774

HI Stefan,

Try to replicate the mail code in a program and write the submit code in the form that you will place in the dynamic action table this will suffice requirement

or .

Use your main program ,declare a parameter under No display mode and pass this variable by submitting the program in your form that you will place in your dynamic action table.

Cheers,

Jacks...