03-03-2021 6:12 PM
Hi all/gurus ,
I have a requirement to send the alv output to mail so I am using the below function .My question is that it is necessary to submit
SUBMIT rsconn01 AND RETURN.
after calling the below function module .Below is a piece of code :-
IF i_output_excel[] IS NOT INITIAL.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = i_output_excel[]
contents_txt = lt_message
receivers = t_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.
ENDIF.
IF sy-subrc IS INITIAL.
WAIT UP TO 1 SECONDS.
SUBMIT rsconn01 AND RETURN.
endif.
Actually I am doing atc check for my code and it is giving priority 1 issue as -->
Search of ABAP Tokens
'
Search String Number 0001 Found in: "#EC CI_SUBMIT
'.Please suggest some ideas or work around .
Regards
Deep
03-03-2021 8:11 PM
You can send immediately an email if you use BCS classes (method SET_SEND_IMMEDIATELY( abap_true ) of CL_BCS). The function module you are using is obsolete.
The interest of grouping emails is a matter of performance (send when server is less busy).
03-04-2021 7:11 AM
Incredible, I wrote a blog about BCS there was 8 years ago. Because I was tired to see people asking about this obsolete FM, and we still have question about it every week 😞
Life is hard
03-04-2021 8:13 AM
frdric.girod better say "all those obsolete FMs" (SO_DOCUMENT_SEND_API1, SO_NEW_DOCUMENT_ATT_SEND_API1, SO_NEW_DOCUMENT_SEND_API1, SO_OBJECT_SEND, SO_OLD_DOCUMENT_SEND_API1, method "Send" of business object type "SOFM", ...)
03-04-2021 12:05 PM
it is submit for email agent and send email immediately,
other wise scheduler job send the required email automatically on scheduled time. you can check the same in sm37 , job name EMAIL AGENT. normaly it runs every 10 minutes.