2010 Apr 06 11:52 AM
Can I send a mail with fm SO_DOCUMENT_SEND_API1 in background mode?
How do it?
Thanks a lot.
cv
2010 Apr 06 12:00 PM
I execute the function but this commited a very long time...
I need execute the function and immediatly return in the abap program...
It's possible?
I execute the function but this commited a very long time...
I need execute the function and immediatly return in the abap program...
It's possible?
2010 Apr 06 11:53 AM
have u tried calling this function module via background task ? I guess it will work.
2010 Apr 06 11:56 AM
Hi,
You don't need to do anything additional to make it function in back ground. Just use it and run in background, there will be no problem.
Thanks & Regards
Rocky
2010 Apr 06 12:00 PM
I execute the function but this commited a very long time...
I need execute the function and immediatly return in the abap program...
It's possible?
2010 Apr 06 12:04 PM
Yes....that you can do by calling the function module in your code by using the statement VIA BACKGROUND TASK, so that it will execute in background task, and control will return to your ABAP program.
2010 Apr 06 12:30 PM
What took so long? Probably not the email send...probably the code that builds what you're sending? My memory is that the API is quick...takes a lot more time to build the tables and structure.
2010 Apr 06 2:29 PM
ok kumar, but with CALL FUNCTION 'SO_DOCUMENT_SEND_API1' in background task the mail is not sent...
2010 Apr 06 8:51 PM
It should work.
Problem lies somewhere else I guess.
Just check ur code.
Regards,
Raveesh
2010 Apr 06 8:54 PM
You can also check in the transaction SOST, send the mails manually from there.
Regards,
Raveesh
2010 Apr 07 9:16 AM
If I execute the function without "in background task" the mail send successfully...
2010 Apr 08 8:04 AM
Solved... The function in background task must be followed by COMMIT WORK (SAP 6.0).
2014 Jan 07 6:12 AM
2014 Jan 28 8:26 AM
......
sender_address = 'WF-BATCH'.
put_in_outbox = 'X'.
wfl_commit_work = 'X'.
clear wsender_address_type.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1' in background task "parte dopo il commit work
EXPORTING
document_data = document_data
put_in_outbox = put_in_outbox
sender_address = sender_address
sender_address_type = wsender_address_type
commit_work = wfl_commit_work
* IMPORTING
* sent_to_all = sent_to_all
* new_object_id = new_object_id
* sender_id = sender_id
TABLES
packing_list = packing_list
OBJECT_HEADER = OBJECT_HEADER
CONTENTS_BIN = CONTENTS_BIN
contents_txt = contents_txt
OBJECT_PARA = OBJECT_PARA
OBJECT_PARB = OBJECT_PARB
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.
commit work.
....
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |