Header problems with e-mail messages....
Edwin Mukusha
emukusha at nebraska.edu
Mon Apr 26 15:00:41 EDT 2004
Dear Eduardo,
Thank you very much for your quick response. I had also tried using FM
SO_OBJECT_SEND and it does not work. Please tell me if you have ever
actually go it to work and what parameters I have to specify in what
combination to get it to work. My SOOS1 structure in my program reads as
seen below.
I finally got my other second option to work. The one were I prefix the
sender's e-mail address with a descriptive text to show the e-mail was an
SAP generated message. (Refer to my original message). But I would like to
still get the reply-to option to work. Thank you.
________________________________________________________________________
data: msg_body like soli occurs 0,
msg_rcpt like soos1 occurs 0 with header line,
hd_change like sood1.
start-of-selection.
clear msg_body.
append 'This is the body of the message.' to msg_body.
append 'It is great!' to msg_body.
clear msg_rcpt.
msg_rcpt-sel = 'X'.
msg_rcpt-recextnam = 'user1 at xxxxxx.edu'.
msg_rcpt-recesc = 'U'.
msg_rcpt-repextnam = 'user2 at xxxxxx.edu'.
msg_rcpt-repesc = 'U'.
* msg_rcpt-sndnam = 'USERIDHERE'.
msg_rcpt-sndex = 'X'.
append msg_rcpt.
clear hd_change.
hd_change-objla = sy-langu.
hd_change-objnam = 'RCPTMAIL'.
hd_change-objdes = 'This is the subject line.'.
hd_change-file_ext = 'RAW'.
hd_change-objlen = 510.
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = hd_change
object_type = 'RAW'
outbox_flag = 'X'
tables
objcont = msg_body
receivers = msg_rcpt
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_no_authorization = 9
object_type_not_exist = 10
operation_no_authorization = 11
owner_not_exist = 12
parameter_error = 13
substitute_not_active = 14
substitute_not_defined = 15
system_failure = 16
too_much_receivers = 17
user_not_exist = 18
originator_not_exist = 19
originator_not_exist = 19
x_error = 20.
if sy-subrc <> 0.
message e999(zh) with 'Function module returned:' sy-subrc.
endif.
________________________________________________________________________
|---------+--------------------------------->
| | Eduardo Pisatti |
| | <Eduardo.Pisatti at basf-|
| | arg.com.ar> |
| | Sent by: SAP Workflow |
| | <Owner-SAP-WUG at MITVMA.|
| | MIT.EDU> |
| | |
| | |
| | 04/26/2004 01:26 PM |
| | Please respond to "SAP|
| | Workflow Users' Group"|
|---------+--------------------------------->
>--------------------------------------------------------------------------------------------------------------|
| |
| To: SAP-WUG at MITVMA.MIT.EDU |
| cc: |
| Subject: Re: Header problems with e-mail messages.... |
>--------------------------------------------------------------------------------------------------------------|
Hi Edwin,
The following is used by us to send mail, internal and external, may be
this can help you.
In OSSS1 you can put for example: From, To (extern mail address), email of
reply (external too), etc.
FUNCTION ZAR_EMAIL.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" REFERENCE(PASUNTO) TYPE SOOD1-OBJDES
*" REFERENCE(PDIREC_EMAIL) TYPE SOOS1-ADR_NAME
*" REFERENCE(PORD_SPOOL) TYPE SOOS1-SNDSPO OPTIONAL
*" TABLES
*" PTEXTO STRUCTURE SOLI
*"----------------------------------------------------------------------
DATA BEGIN OF OBJECT_HD_CHANGE. "SAPoffice: object definition,
INCLUDE STRUCTURE SOOD1. "change attributes
DATA END OF OBJECT_HD_CHANGE.
DATA BEGIN OF OBJECT_CONTENT OCCURS 5. "SAPoffice: Single List with
INCLUDE STRUCTURE SOLISTI1. "Column Length 255
DATA END OF OBJECT_CONTENT.
DATA BEGIN OF REC_TABLE OCCURS 1. "SAPoffice: recipient with
INCLUDE STRUCTURE SOOS1. "attributes
DATA END OF REC_TABLE.
* Build email recipient table...........................................
CLEAR REC_TABLE.
REC_TABLE-SEL = 'X'.
REC_TABLE-RECESC = 'U'.
*rec_table-recnam = 'BASF'.
REC_TABLE-RECEXTNAM = PDIREC_EMAIL.
TRANSLATE REC_TABLE-RECEXTNAM TO LOWER CASE.
REC_TABLE-ADR_NAME = PDIREC_EMAIL.
TRANSLATE REC_TABLE-ADR_NAME TO LOWER CASE.
REC_TABLE-SNDEX = 'X'.
REC_TABLE-SNDPRI = '1'.
REC_TABLE-MAILSTATUS = 'E'.
REC_TABLE-SNDSPO = PORD_SPOOL .
COLLECT REC_TABLE.
*...Subject.Line........................................................
CLEAR OBJECT_HD_CHANGE.
OBJECT_HD_CHANGE-OBJDES = PASUNTO.
* Send Email............................................................
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_TYPE = 'RAW'
OUTBOX_FLAG = 'X'
TABLES
OBJCONT = PTEXTO
RECEIVERS = REC_TABLE
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
ORIGINATOR_NOT_EXIST = 20
X_ERROR = 21
OTHERS = 22.
*...SAPconnect.........................................................
*...Start to Dispach mail
SUBMIT RSCONN01 "SAPconnect Start Send Process
WITH MODE EQ '*'
WITH OUTPUT EQ ''
TO SAP-SPOOL
DESTINATION 'LOCAL'
IMMEDIATELY ' '
KEEP IN SPOOL 'X'
WITHOUT SPOOL DYNPRO
AND RETURN.
Edwin Mukusha
<emukusha at nebraska. Para:
SAP-WUG at MITVMA.MIT.EDU
edu> cc:
Enviado por: SAP Asunto: Header problems
with e-mail messages....
Workflow
<Owner-SAP-WUG at MITV
MA.MIT.EDU>
26/04/2004 12:45
Por favor, responda
a "SAP Workflow
Users' Group"
Hi everyone,
I am trying to find a way to specify a reply-to address on a message coming
out of SAP. We currently use the MTA connection to Lotus to send e-mail
messages from our workflow. We are running 4.6C.
Some background: I have a process that sends exception messages to
responsible parties about budget balances in Project Systems. Currently
these e-mail messages have the wf-batch e-mail address
(SAPWorkflowproduction at xxxx.com) that is mapped back to my lotus inbox.
I need to be able to get these messages with a different sender to reply
to, as currently my inbox is getting swamped with end-user queries/feedback
on their budget balances!
I have been able to create a method that will allow me to specify a
different sender using function module 'SO_DOCUMENT_SEND_API1'. However
this solution gives me a message that looks like it was actually generated
by that sender, yet it originated from SAP. My ideal solution would be for
the message to read as follows:
>From: SAPWorkflowproduction at xxxx.com
>Reply-to: psmanager at xxxx.com
>Sent: Thursday,22 June 2004 5:48 AM
>To: enduser at xxxx.com
>Subject: Exception budget Balances
If the reply-to option is not possible. I am willing to take a second
possible solution; is it possible to specify some text prefixing the
sender's address coming out SAP? If this is possible I would then be able
to pad sender's e-mail address like this maybe:
example taken from:
"SAP Workflow Users' Group" <SAP-XXX at MITVMA.MIT.EDU>
mine would look like this:
>From: "Message sent from SAP WF on behalf of" <psmanager at xxxx.com>
>Sent: Thursday,22 June 2004 5:48 AM
>To: enduser at xxxx.com
>Subject: Exception budget Balances
Searching through our WF discussion group was a challenge because the
keyword reply-to is in just about every message on this list. I have also
searched through OSS without much luck.
I would appreciate any help on this matter.
Thanks...
Edwin Mukusha.
More information about the SAP-WUG
mailing list