Application Development 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: 

How to set send immediate option in function module SO_DOCUMENT_SEND_API1

Former Member
0 Kudos

Hi Team,

How to set send immediate option in function module SO_DOCUMENT_SEND_API1, to send mail immediately without waiting in SOST.

Thanks.

6 REPLIES 6

former_member196331
Active Contributor
0 Kudos

I hope Some Configuration At SOST, Basis people has to do  the Work.

satyabrata_sahoo3
Contributor
0 Kudos

The email is not sent immediately but collected, and send as per the Period set by BASIS in SCOT configuration.

Ex. as attached..

Either SOST transaction has to be used to release them, or you can call RSCONN01 program.

Do this after calling the FM 'SO_NEW_DOCUMENT_SEND_API1'

  SUBMIT rsconn01 USING SELECTION-SET 'INT' AND RETURN.

You can use class CL_BCS to send emails and the method allows an immediate send without affecting other emails in the queue.

        CALL METHOD LR_SEND_REQUEST->SET_SEND_IMMEDIATELY

          EXPORTING

            I_SEND_IMMEDIATELY = 'X'.

-Satya

0 Kudos

Hi Satya,

Thanks for your reply, please let me know how to use

CALL METHOD LR_SEND_REQUEST->SET_SEND_IMMEDIATELY

          EXPORTING

            I_SEND_IMMEDIATELY = 'X'.

after calling function module SO_NEW_DOCUMENT_SEND_API1.

Thanks.

0 Kudos

Thats in case you are using CL_BCS to send email.

Instead you can use below code after calling function module SO_NEW_DOCUMENT_SEND_API1.

SUBMIT rsconn01 WITH mode = 'INT'

                  WITH output = ''

                  AND RETURN.

-Satya

Former Member
0 Kudos

Hi,

Why not use CL_BCS class for sending the mail. Its simple to use and there are n no of posts out there in SCN on this.

Sample below

TRY.
* Pass the document to send request
     lo_send_request->set_document( lo_document ).

     "Create recipient
     lo_recipient = cl_cam_address_bcs=>create_internet_address( p_email ).

**Set recipient
     lo_send_request->add_recipient( lo_recipient ).

* Send email

     lo_send_request->SET_SEND_IMMEDIATELY('X').
     lo_send_request->send(
       EXPORTING
         i_with_error_screen = 'X'
       RECEIVING
         result = lv_sent_to_all ).

     COMMIT WORK.

     IF lv_sent_to_all IS INITIAL.
       MESSAGE i500(sbcoms) WITH lv_send.
     ELSE.


CATCH cx_document_bcs INTO lx_document_bcs.

ENDTRY.

0 Kudos

Hi Gaurav,

Thanks for your reply, please let me know how to use

CALL METHOD LR_SEND_REQUEST->SET_SEND_IMMEDIATELY

          EXPORTING

            I_SEND_IMMEDIATELY = 'X'.

after calling function module SO_NEW_DOCUMENT_SEND_API1.

Thanks.