2014 May 08 11:30 AM
Hi Experts,
I am trying to use CL_BCS to send mails for specific mail ids (maintained in Z table) as receiver and sender.
The issue is that there are methods to set receiver and sender by specifying fields of type SY-UNAME.
Are there any methods I can use to set the specific mail ids as sender and receiver?
Thanks,
Vitish.
Hi Experts,
I am trying to use CL_BCS to send mails for specific mail ids (maintained in Z table) as receiver and sender.
The issue is that there are methods to set receiver and sender by specifying fields of type SY-UNAME.
Are there any methods I can use to set the specific mail ids as sender and receiver?
Thanks,
Vitish.
2014 May 08 11:47 AM
Hi,
* Set Sender Email Address
IF BCS_EXCEPTION IS INITIAL.
TRY.
SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( '[email protected]' ).
CATCH CX_ADDRESS_BCS INTO BCS_EXCEPTION.
ENDTRY.
ENDIF.
IF BCS_EXCEPTION IS INITIAL.
TRY.
CALL METHOD SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = SENDER.
CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION.
ENDTRY.
ENDIF.
* Set Recipient Email Addresses
IF BCS_EXCEPTION IS INITIAL.
TRY.
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( '[email protected]' ).
CATCH CX_ADDRESS_BCS INTO BCS_EXCEPTION.
ENDTRY.
ENDIF.
IF BCS_EXCEPTION IS INITIAL.
TRY.
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT.
CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION.
ENDTRY.
ENDIF.
for sending to more users loop the code of receiver.
Regards
Srikanth