10-11-2007 9:04 AM
Hi,
Is it possible to change the email sender using the FM
'SO_NEW_DOCUMENT_ATT_SEND_API1' ???
Thanks!!
10-11-2007 9:07 AM
hi,
i dont think its possible.
it will show email id of sender from which mail has been sent.
to change the sender-id u can go to SU01 transaction and change it.
regards
vivek
10-11-2007 9:09 AM
10-11-2007 9:28 AM
Hi,
I think if you use the class you can change it. It also is more flexible I think.
* Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
* Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
If you need a full example just let me know.
Cheers,
Kevin
10-11-2007 10:28 AM
10-11-2007 10:55 AM
There you go:
ATA: document TYPE REF TO cl_document_bcs,
send_request TYPE REF TO cl_bcs,
sender TYPE REF TO cl_sapuser_bcs,
recipient TYPE REF TO if_recipient_bcs,
doc_type type SO_OBJ_TP,
doc_subject type SO_OBJ_DES,
doc_text_tab type SOLI_TAB,
doc_wa like line of doc_text_tab.
*Create mail
doc_type = 'TXT'.
doc_subject = 'test pdf'.
doc_wa = 'test pdf with attachment'.
append doc_wa to doc_text_tab.
document = cl_document_bcs=>create_document(
i_type = doc_type
i_text = doc_text_tab
i_subject = doc_subject ).
*Add attachment
doc_type = 'PDF'.
doc_subject = 'test'.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = doc_type
i_attachment_subject = doc_subject
i_att_content_hex = lt_data.
send_request = cl_bcs=>create_persistent( ).
CALL METHOD send_request->set_document( document ).
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
recipient = cl_cam_address_bcs=>create_internet_address( 'kras@eozen.com' ).
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
send_request->set_send_immediately( 'X' ).
CALL METHOD send_request->send( ).
COMMIT WORK.
Cheers,
Kevin.
10-11-2007 11:41 AM
Thanks.
I´ll use the FM SO_DOCUMENT_SEND_API1 or Kevi´s solution.
bye and thanks again