03-03-2010 7:01 PM
Hi All,
In my functionality previously, I used FM 'SO_DOCUMENT_SEND_API1' wherein I can freely customized the sender and recipient. But I need to change it to BCS class due to 50 character limitation in Subject.
Please see thread .
DATA: recipient TYPE REF TO if_recipient_bcs.
*SENDER*
"Set Sender
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
The code above would always trigger the email of the owner of SY-UNAME. In my case, I need a custom one email, let's say, a hard coded non SY-UNAME email.
What I did:
Change the data definition of sender as follow, but this would give me not compatible type parameter.
DATA: sender TYPE REF TO if_sender_bcs.
"sender = cl_sapuser_bcs=>create( '<sender_email_literal_goes_here>' ).
Question: Is this possible? or the class is fixed to SY-UNAME's email?
03-03-2010 9:13 PM
03-03-2010 7:02 PM
Hi All, again.. continuation..
RECIPIENT
Question: How can I change the single hard code recipient email pulling the data from an Internal Table?
DATA: recipient TYPE REF TO if_recipient_bcs.
recipient = cl_cam_address_bcs=>create_internet_address(
'<recipient_email_literal_goes_here>' ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
Thanks All.
03-03-2010 7:50 PM
03-03-2010 9:13 PM
03-03-2010 9:16 PM
Hi Keeshav,
Yes I already checked BCS programs 1-6, but they all use only 1 Recipient Email. Thanks.
03-04-2010 3:50 AM
Check this.
Here S_EMAIL is selection screen input with multiple email ids
LOOP AT S_EMAIL.
LV_RECEIVER = S_EMAIL-LOW..
LR_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( LV_RECEIVER ).
CALL METHOD LR_CL_SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = LR_RECIPIENT
I_EXPRESS = 'X'.
ENDLOOP.
a®
03-06-2010 6:49 PM
Hi ArS,
DATA: w_receiver TYPE string.
LOOP AT itab_email ASSINGNING <fs_email>.
recipient = cl_cam_address_bcs=>create_internet_address( w_receiver ).
ENDLOOP.
I'm having an error: w_receiver is not type-compatible with formal parameter I_ADDRESS_STRING,
I also tried using
DATA: w_receiver(50) TYPE c.
but still have the same error.
03-07-2010 6:38 AM
Try with
data: w_receiver TYPE ad_smtpadr.
This will resolve the issue
a®
03-08-2010 1:53 PM
Hi ArS, it's working now as a program.
Still part of the thread.
Now I want to create a FM for this:
In my Function Group>TOP INCLUDE, I have
DATA: sender TYPE REF TO if_sender_bcs,
w_sender TYPE ad_smtpadr.
In my FM code:
IMPORT Parameter:
SENDER TYPE AD_SMTPADR
sender = cl_cam_address_bcs=>create_internet_address( w_sender ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
SYNTAX ERROR: The field "SENDER" cannot be changed.
03-08-2010 4:01 PM
Ars has been very patient with you, even though your questions are getting more and more basic. Hope he gets the credit he deserves.
By the way: When using sender as IMPORT parameter, you can not change it. Use the changing parameter instead or exporting when you are not already importing and existing sender (which would not be logical in your case).
03-08-2010 4:35 PM
03-08-2010 4:35 PM