Application Development and Automation 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: 
Read only

From Address

Former Member
0 Likes
611

Hello,

While sending mail thru SAP, is there any way to use a genric email address for the FROM address, currently it is pulling based on the user login. Instead of this i want to use a genric email id.

Thanks,

Thirumal

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
565

Yes, but you can only do this using the SO_OBJECT_SEND function module. Here is a sample program.



report zrich_0001.

data: mailtxt  type table of solisti1 with header line.
data: maildata type  sood1.
data: mailrec  type table of soos1 with header line.

start-of-selection.

  clear:    maildata, mailtxt,  mailrec.
  refresh:  mailtxt, mailrec.

  mailrec-recextnam = '[email protected]'.
  mailrec-recesc    = 'E'.
  mailrec-sndpri    = '1'.
  mailrec-sndart    = 'INT'.
  mailrec-mailstatus = 'E'.
  append mailrec.

  maildata-objnam = 'TEST'.
  maildata-objdes = 'Test'.
  maildata-objla = sy-langu.

  mailtxt-line = 'This is a test'.
  append mailtxt.


  call function 'SO_OBJECT_SEND'
       exporting
            object_hd_change           = maildata
            object_type                = 'RAW'
            outbox_flag                = 'X'
            originator                 = '[email protected]'  "Sender email
            originator_type            = 'U'
       tables
            objcont                    = mailtxt
            objhead                    = mailtxt
            receivers                  = mailrec
       exceptions
            object_not_sent            = 15
            object_type_not_exist      = 17
            operation_no_authorization = 21
            parameter_error            = 23
            too_much_receivers         = 73
            others                     = 1000.

Regards,

Rich Heilman

Yes, but you can only do this using the SO_OBJECT_SEND function module. Here is a sample program.



report zrich_0001.

data: mailtxt  type table of solisti1 with header line.
data: maildata type  sood1.
data: mailrec  type table of soos1 with header line.

start-of-selection.

  clear:    maildata, mailtxt,  mailrec.
  refresh:  mailtxt, mailrec.

  mailrec-recextnam = '[email protected]'.
  mailrec-recesc    = 'E'.
  mailrec-sndpri    = '1'.
  mailrec-sndart    = 'INT'.
  mailrec-mailstatus = 'E'.
  append mailrec.

  maildata-objnam = 'TEST'.
  maildata-objdes = 'Test'.
  maildata-objla = sy-langu.

  mailtxt-line = 'This is a test'.
  append mailtxt.


  call function 'SO_OBJECT_SEND'
       exporting
            object_hd_change           = maildata
            object_type                = 'RAW'
            outbox_flag                = 'X'
            originator                 = '[email protected]'  "Sender email
            originator_type            = 'U'
       tables
            objcont                    = mailtxt
            objhead                    = mailtxt
            receivers                  = mailrec
       exceptions
            object_not_sent            = 15
            object_type_not_exist      = 17
            operation_no_authorization = 21
            parameter_error            = 23
            too_much_receivers         = 73
            others                     = 1000.

Regards,

Rich Heilman

2 REPLIES 2
Read only

Former Member
0 Likes
565

Try using SO_OBJECT_SEND functional module

Regards

Anurag

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
566

Yes, but you can only do this using the SO_OBJECT_SEND function module. Here is a sample program.



report zrich_0001.

data: mailtxt  type table of solisti1 with header line.
data: maildata type  sood1.
data: mailrec  type table of soos1 with header line.

start-of-selection.

  clear:    maildata, mailtxt,  mailrec.
  refresh:  mailtxt, mailrec.

  mailrec-recextnam = '[email protected]'.
  mailrec-recesc    = 'E'.
  mailrec-sndpri    = '1'.
  mailrec-sndart    = 'INT'.
  mailrec-mailstatus = 'E'.
  append mailrec.

  maildata-objnam = 'TEST'.
  maildata-objdes = 'Test'.
  maildata-objla = sy-langu.

  mailtxt-line = 'This is a test'.
  append mailtxt.


  call function 'SO_OBJECT_SEND'
       exporting
            object_hd_change           = maildata
            object_type                = 'RAW'
            outbox_flag                = 'X'
            originator                 = '[email protected]'  "Sender email
            originator_type            = 'U'
       tables
            objcont                    = mailtxt
            objhead                    = mailtxt
            receivers                  = mailrec
       exceptions
            object_not_sent            = 15
            object_type_not_exist      = 17
            operation_no_authorization = 21
            parameter_error            = 23
            too_much_receivers         = 73
            others                     = 1000.

Regards,

Rich Heilman