Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

EMAIL SENDER

Former Member
0 Kudos

Hi,

Is it possible to change the email sender using the FM

'SO_NEW_DOCUMENT_ATT_SEND_API1' ???

Thanks!!

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Ya.. Its not possible.

Thanks.

Former Member
0 Kudos

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

0 Kudos

Yes, please !!

Thanks!!

Former Member
0 Kudos

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.

Former Member
0 Kudos

Thanks.

I´ll use the FM SO_DOCUMENT_SEND_API1 or Kevi´s solution.

bye and thanks again