on ‎2025 Jun 25 4:46 PM
Hey Community!
Is there a way to send a mail to a specified time using CL_BCS?
I did not find any hint where to set a time when the mail should be sent.
Yes, I know, I can program a job that starts to that time and sends the mail, but I wonder if there is a built-in way for this.
Thanks for any hints
~Enno
Request clarification before answering.
You could try the following but you'd also have to put in work to generate the timestamp for a future date/time and the domain definition suggests UTC. Please note that I believe the normal way would be to call the SEND_SCREEN method which appears to allow a user to input such information.
DATA: email TYPE REF TO cl_bcs,
exc TYPE REF TO cx_bcs.
* Generate one in the future for true delay
GET TIME STAMP FIELD DATA(timestamp).
TRY.
* Generate send request
email = cl_bcs=>create_persistent( ).
email->send_request->set_send_at( timestamp ).
* Create and set document
...
* Create sender and recipient addresses
...
* Send document
DATA(sent) = email->send( ).
IF sent IS NOT INITIAL.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.
CATCH cx_bcs INTO exc.
* No email sent - do nothing here
ENDTRY.
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I'm aware, this isn't something you can do with CL_BCS. You can easily submit a background delayed job, working with SOST/SCOT tables is risky and more difficult.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.