on 12-17-2008 12:03 AM
Hello, ppl
I've been doing some developing concerning the send of correspondence by email.
I've used output medium 5, and have have build email recipient parameters as follow:
Getting email address:
CLEAR address.
SELECT SINGLE smtp_addr FROM adr6
INTO address
WHERE addrnumber = p_adrnr
AND persnumber = space
AND flgdefault = 'X'.
IF address IS INITIAL.
p_device = 'PRINTER'.
EXIT.
ENDIF.
create recipient
swc_create_object lo_recipient 'RECIPIENT' space.
swc_set_element lt_container 'SendAsACopy'
'X'.
swc_set_element lt_container 'AddressString'
address.
swc_set_element lt_container 'TypeID'
'U'.
swc_call_method lo_recipient 'CreateAddress' lt_container.
swc_object_to_persistent lo_recipient p_persistent_recipient.
create sender (current user)
swc_create_object lo_sender 'RECIPIENT' space.
swc_set_element lt_container 'AddressString'
sy-uname.
swc_set_element lt_container 'TypeID' 'B'.
swc_call_method lo_sender 'CreateAddress' lt_container.
swc_object_to_persistent lo_sender p_persistent_sender.
And have called open_form as follows:
CALL FUNCTION 'OPEN_FORM'
EXPORTING form = xformular
language = ekko-spras
OPTIONS = itcpo
archive_index = toa_dara
archive_params = arc_params
device = xdevice
dialog = xdialog
mail_sender = p_persistent_sender
mail_recipient = p_persistent_recipient
EXCEPTIONS canceled = 01.
IF sy-subrc NE 0.
PERFORM protocol_update USING '142' ekko-ebeln space space space.
retco = sy-subrc.
EXIT.
ENDIF.
Everything works fine ... problem is i need to send the email to several adresses and also add some as CC: instead of TO: in the email parameters.
Is this possible?
As far as i know mail_ricipient only allows one email reference ...
Please, provide some help.
Thanks,
Mário
LOOP AT <receiver_table>.
w_email = <receiver_table-mailid.
*-- Create persistent send request
send_request = cl_bcs=>create_persistent( ).
*--Add document to send request
CALL METHOD send_request->set_document( document ).
*-- Get sender object
sender = cl_sapuser_bcs=>create(<Sender mailid / userid ).
*--Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
recipient = cl_cam_address_bcs=>create_internet_address( w_email ).
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( P_RECVR ).
*--Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient.
*--set send immediately flag
send_request->set_send_immediately( 'X' ).
*--Send document
CALL METHOD send_request->send( ).
COMMIT WORK.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try to use this FM SO_NEW_DOCUMENT_SEND_API1
works for smartforms but not sure for scripts so just try it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.