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: 

SAPConnect : how to change sender email address?

Former Member
0 Kudos

Hi,

I have a requirement to make it appear as though the sender email address for all documents sent via SAPConnect comes from one generic e-mail address.

I don't want to change the documents, just make it appear to the recipients as though they all come from one e-mail address.

Regards,

Aidan

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

how are you sending the mails.

if its using class CL_BCS you can add the following like of code to set the sender

data: sender type ref to cl_sapuser_bcs.

sender = cl_sapuser_bcs=>create( 'BATCHID' ).

call method send_request->set_sender

exporting

i_sender = sender.

or if you are using the FM SO_DOCUMENT_SEND_API1 you can set the SENDER_ADDRESS parameter

Regards

Raja

9 REPLIES 9

suresh_datti
Active Contributor
0 Kudos

Hi,

interesting reqt.. but I doubt if it is possible.. As the sender address is part of the Document to be sent.. SCOT only triggers the send process.. Also, by default it is the sy-uname that is shown as the sender and not all the SO_* function modules have the option to change this.. so it is not possible to put a generic sender address even at the document creation stage for all emails.. Did you check with OSS?

Regards,

Suresh Datti

0 Kudos

Suresh,

OSS notes 191470 and 129950 merely state that the user profile of the sender is the only place the sender email will be taken from.

I wonder if there could be a way of forcing a value, for example by copying and changing program RSCONN01 or an associated program, and I curious to hear if anyone has already achieved it.

Regards,

Aidan

0 Kudos

Hi Aidan,

The RSCONN** Programs come into picture right at the very end of the mail process.. the documents will have been created by then with the sender address either from User Profile or the custom program where the doc is created.. I don't think you have much scope here other than setting all the User Profiles to the generic Email Address.(which in any way doesn't look like a good option)..

Regards,

Suresh Datti

P.S. Welcome to SDN & pl reward helpful answers

0 Kudos

Hi aidan,

One way is change the Email address in the user profile using the transaction SU01.

The other work around could be...

-> 1.Write an ABAP Program to change the Email address temporarily using the BAPI_USER_CHANGE...

-> 2.Send the mail

-> 3.Change the Email address back to the original.

Hope it helps...

Lokesh

pls. reward appropriate points

0 Kudos

Hi Lokesh,

Your idea sounds good. Unless anyone else has a better idea I will probably go with that.

Regards,

Aidan

0 Kudos

Hi Aidan,

this is how we set our own sender (note the include is necessary!):

FUNCTION z_cafm_get_custom_sender001 .

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(I_SENDERUSER) TYPE SY-UNAME

*" EXPORTING

*" REFERENCE(E_SENDER_ID) TYPE SWOTOBJID

*"----


INCLUDE <cntn01>.

DATA: sender TYPE swc_object.

  • Declares the container

swc_container container.

  • generate ref to recipient (which is a sender

swc_create_object sender 'RECIPIENT' space.

  • clear container

swc_clear_container container.

  • address current internal user

swc_set_element container 'AddressString' i_senderuser.

  • address type (internal user)

swc_set_element container 'TypeId' 'B'.

  • Call of method recipient.FindAddress

swc_call_method sender 'FindAddress' container.

  • Output error message for exception

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno.

ENDIF.

  • Determine BOR object ID

swc_object_to_persistent sender e_sender_id.

ENDFUNCTION.

Hope this helps,

//Julian

0 Kudos

Hi Julian,

I'm working in SRM and that include is not available.

Aidan

athavanraja
Active Contributor
0 Kudos

how are you sending the mails.

if its using class CL_BCS you can add the following like of code to set the sender

data: sender type ref to cl_sapuser_bcs.

sender = cl_sapuser_bcs=>create( 'BATCHID' ).

call method send_request->set_sender

exporting

i_sender = sender.

or if you are using the FM SO_DOCUMENT_SEND_API1 you can set the SENDER_ADDRESS parameter

Regards

Raja

Former Member
0 Kudos

Hi,

Go to transaction SWU3.

Under Automatic Workflow Customizing, click on

"Maintain Workflow System Administrator" and execute.

Give the SAP user name.

This user name will appear as Sender in the recipients' inboxes.

Hope this helps..

Regards,

Shashank