cancel
Showing results for 
Search instead for 
Did you mean: 

Send mails: Use correct Vendor mail id from vendor master data.

michael_hrner
Explorer
0 Kudos

Hello,

we want to send out mails for different applications. Therefor we have mulitple email ids in vendor master and maintained the field notes behind each mail adress with a application key.

In the include LV61BF0C there is a user exit for faxes, where we could say which is my fax number. But I didn't found anything for saying which mail adress the system should use.

I seached in the function module: SO_OBJECT_Send and SBCOMS_SEND_REQUEST_CREATE in debugging mode, but didnt find a solution

Can someone give me a short hint/tip?

Thanks in Advance.

Regards Michael

Accepted Solutions (0)

Answers (4)

Answers (4)

michael_hrner
Explorer
0 Kudos

Hello,

I guess my first text was not written exactly.

To send an email with an own program is very easy.

Where I can put in my own search logic for the correct vendor mail adress, stored in ADR6 (vendor master data) before the mail will be send out. As I wrote in my first question, there is a exit for using a own fax determination logic, but I did't found any Enhancement point, Exit, Badi or something else where I can say, according the mail id key, stored in the notes field in vendor master data, which is the correct mail id for sending to.

Thanks a lot for a hint or tip.

Regards,

Michael

michael_hrner
Explorer
0 Kudos

Hello all,

has someone any idea or implemented something like this in a enhancement point or section?

I guess a user exit is not available.

Thanks

Regards,

Michael

Abhijit74
Active Contributor
0 Kudos

Hi,

Use these function module below.

SO_NEW_DOCUMENT_ATT_SEND_API1

SO_DOCUMENT_SEND_API1

Code Snip:

DATA: objcont LIKE solisti1 OCCURS 0 WITH HEADER LINE.

DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.

DATA: doc_chng LIKE sodocchgi1.

  • Email subject line

doc_chng-obj_descr = 'Email subject'.

  • Email body

objcont = 'This is a line to be sent in the email body'.

APPEND objcont.

  • Receiver list

reclist-receiver = 'your email address here'.

reclist-rec_type = 'U'.

APPEND reclist.

  • Send the document

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = doc_chng

commit_work = 'X'

TABLES

object_content = objcont

receivers = reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

IF sy-subrc <> 0.

MESSAGE 'Email could not be sent' TYPE 'I'.

ELSE.

MESSAGE 'Email was sent successfully' TYPE 'I'.

ENDIF.

Thanks,

Abhijit

Himayatullah
Active Participant
0 Kudos

hi,

You can get the mail address from ADR6 table. Field is SMTP_ADDR.

FM to send mail is SO_NEW_DOCUMENT_ATT_SEND_API1

Best Regards

Himayat

Former Member
0 Kudos

try function module 'SO_NEW_DOCUMENT_SEND_API1'