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: 

Changing senders mail address in 'SO_NEW_DOCUMENT_SEND_API1'

Former Member
0 Kudos

Dear All,

I am using the function module 'SO_NEW_DOCUMENT_SEND_API1' for sending mail to the vendors.

The problem is when the mail is sent from this function module it takes the name of the user logged in in the senders address.

I want to send the mail by some other mail id, so is it possible to change the senders address in this function module.

If not , then is there any other way by which we can send mail and can change the senders addess .

Thanks and Regards

Manik L Dhakate

6 REPLIES 6

Former Member
0 Kudos

Hi,

*--


Method 1--
*

CALL FUNCTION 'SUSR_USER_ADDRESS_READ'

EXPORTING

user_name = wf_user

IMPORTING

user_address = it_address

EXCEPTIONS

user_address_not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

wf_addr_no = it_address-addrnumber.

wf_pers_no = it_address-persnumber.

SELECT SINGLE smtp_addr FROM adr6 INTO wf_addr

WHERE persnumber EQ wf_pers_no AND

addrnumber EQ wf_addr_no.

IF sy-subrc = 0.

p_add = wf_addr.

ENDIF.

*----


Another metheod -
*

PARAMETERS: p_add(50) TYPE c.

Data: it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.

IF p_add IS NOT INITIAL.

CLEAR it_receivers.

IF p_user = c_x.

it_receivers-rec_type = 'B'. "SAP-Username

ELSEIF p_dl = 'X'.

it_receivers-rec_type = 'C'. "Distribution list

ELSEIF p_int = 'X'.

it_receivers-rec_type = 'U'. "Internet Address

ENDIF.

it_receivers-receiver = p_add.

it_receivers-express = 'X'.

APPEND it_receivers.

ENDIF.

Former Member
0 Kudos

Hi,

*--


Method 1--
*

CALL FUNCTION 'SUSR_USER_ADDRESS_READ'

EXPORTING

user_name = wf_user

IMPORTING

user_address = it_address

EXCEPTIONS

user_address_not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

wf_addr_no = it_address-addrnumber.

wf_pers_no = it_address-persnumber.

SELECT SINGLE smtp_addr FROM adr6 INTO wf_addr

WHERE persnumber EQ wf_pers_no AND

addrnumber EQ wf_addr_no.

IF sy-subrc = 0.

p_add = wf_addr.

ENDIF.

*----


Another metheod -
*

PARAMETERS: p_add(50) TYPE c.

Data: it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.

IF p_add IS NOT INITIAL.

CLEAR it_receivers.

IF p_user = c_x.

it_receivers-rec_type = 'B'. "SAP-Username

ELSEIF p_dl = 'X'.

it_receivers-rec_type = 'C'. "Distribution list

ELSEIF p_int = 'X'.

it_receivers-rec_type = 'U'. "Internet Address

ENDIF.

it_receivers-receiver = p_add.

it_receivers-express = 'X'.

APPEND it_receivers.

ENDIF.

Reward If Helpful.

0 Kudos

Hi Disha,

Thanks for ur reply but I think u didnt got my requirement.

My requirement is just I want to know whether it is possible to change the senders address in the function module SO_NEW_DOCUMENT_SEND_API1 .

If yes please tell me the way to do it.

If not then ,is there any other function module from which we can send mail and where we can change the senders name or mail id.

Thanks n Regards

Manik L Dhakate

0 Kudos

I think what you have to do is to change your e-mail in tranaction SU01.

Hope it helps...

P.S. Please award points if it helps...

former_member194669
Active Contributor
0 Kudos

Hi,

look at SO_DOCUMENT_SEND_API1, you can change the sender address/name with this FM. You cannot do it with NEW...

aRs

Former Member
0 Kudos

Manik,

In 'SO_NEW_DOCUMENT_SEND_API1' you can fix the Sender address with the SAP user id. & in the user id maintainence i.e. SU01 enter the SMTP email address you want to fix.