2005 Oct 25 3:49 PM
Hi all.
I want to use the FM: SO_NEW_DOCUMENT_SEND_API1 to send emails to internet address(e.g [email protected]), this function executes without exceptions but the mail is not sent.
I'm doing something like this:
DATA:
IT_I0105_DB TYPE STANDARD TABLE OF PA0105 WITH HEADER LINE,
IT_PA0032 TYPE STANDARD TABLE OF TY_PA0032 WITH HEADER LINE,
IT_DESTINO LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE,
IT_TEXTO LIKE SOLI OCCURS 10 WITH HEADER LINE,
IT_TITULO LIKE SODOCCHGI1 OCCURS 0 WITH HEADER LINE,
V_USNAME LIKE SY-UNAME,
V_NAME LIKE ESS_EMP-NAME,
V_SHORT LIKE P1000-SHORT,
V_STEXT LIKE P1000-STEXT,
V_EMPLEADO TYPE STRING,
V_UNIORG TYPE STRING,
V_UBICACION TYPE STRING,
V_EXTENSION TYPE STRING,
V_MAIL TYPE HRWPC_S_CONTACT-EMAIL.
Receiver
MOVE: V_MAIL TO IT_DESTINO-RECEIVER,
'U' TO IT_DESTINO-REC_TYPE,
' ' TO IT_DESTINO-EXPRESS.
APPEND IT_DESTINO.
Title
IT_TITULO-OBJ_NAME = 'EMAIL'.
IT_TITULO-OBJ_DESCR = 'PRUEBA DEL MAIL'.
APPEND IT_TITULO.
Content
IT_TEXTO-LINE = V_EMPLEADO.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_UBICACION.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_EXTENSION.
APPEND IT_TEXTO.
IT_TEXTO-LINE = P_PERIODO.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_UNIORG.
APPEND IT_TEXTO.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = IT_TITULO
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = ''
TABLES
OBJECT_CONTENT = IT_TEXTO
RECEIVERS = IT_DESTINO
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
I dont know whats happening.
I hope somebody can helps me to solve my problem.
Thx
Regards.
Gregory
Hi all.
I want to use the FM: SO_NEW_DOCUMENT_SEND_API1 to send emails to internet address(e.g [email protected]), this function executes without exceptions but the mail is not sent.
I'm doing something like this:
DATA:
IT_I0105_DB TYPE STANDARD TABLE OF PA0105 WITH HEADER LINE,
IT_PA0032 TYPE STANDARD TABLE OF TY_PA0032 WITH HEADER LINE,
IT_DESTINO LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE,
IT_TEXTO LIKE SOLI OCCURS 10 WITH HEADER LINE,
IT_TITULO LIKE SODOCCHGI1 OCCURS 0 WITH HEADER LINE,
V_USNAME LIKE SY-UNAME,
V_NAME LIKE ESS_EMP-NAME,
V_SHORT LIKE P1000-SHORT,
V_STEXT LIKE P1000-STEXT,
V_EMPLEADO TYPE STRING,
V_UNIORG TYPE STRING,
V_UBICACION TYPE STRING,
V_EXTENSION TYPE STRING,
V_MAIL TYPE HRWPC_S_CONTACT-EMAIL.
Receiver
MOVE: V_MAIL TO IT_DESTINO-RECEIVER,
'U' TO IT_DESTINO-REC_TYPE,
' ' TO IT_DESTINO-EXPRESS.
APPEND IT_DESTINO.
Title
IT_TITULO-OBJ_NAME = 'EMAIL'.
IT_TITULO-OBJ_DESCR = 'PRUEBA DEL MAIL'.
APPEND IT_TITULO.
Content
IT_TEXTO-LINE = V_EMPLEADO.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_UBICACION.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_EXTENSION.
APPEND IT_TEXTO.
IT_TEXTO-LINE = P_PERIODO.
APPEND IT_TEXTO.
IT_TEXTO-LINE = V_UNIORG.
APPEND IT_TEXTO.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = IT_TITULO
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = ''
TABLES
OBJECT_CONTENT = IT_TEXTO
RECEIVERS = IT_DESTINO
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
I dont know whats happening.
I hope somebody can helps me to solve my problem.
Thx
Regards.
Gregory
2005 Oct 25 3:54 PM
2005 Oct 25 3:56 PM
Thx Rich.
Yeap i'm using SCOT transaction to send the mail.
Regards.
Gregory.
2005 Oct 25 4:04 PM
2005 Oct 25 4:22 PM
No, when i execute the transaction SCOT it says: "No messages sent".
Thx
Gregory
2005 Oct 25 4:24 PM
Maybe your mail is waiting, then you have to send the process. If your admin sys does not create the job to send mail, you have to perform this step manualy
Regards
Frédéric
2005 Oct 25 4:52 PM
Well Frédéric, i'm trying to perform this step with the SCOT transaction, but this transaction says that there are no mails to send.
Thx n rgds.
Gregory.
2005 Oct 25 7:32 PM
Please i need help to solve the problems.
Thx n Rgds.
Gregory.
2005 Oct 25 7:39 PM
2005 Oct 25 7:55 PM
Thx all i solve the problem. Set the import parameter COMMIT_WORK to 'X' did the work.
Now i see that the mail is sent with the mail cofigured in SU01 transaction. Is there any way to Set the 'FROM' attribute of the mail? If so, then i want to know it.
Or is there any other function that sends internet mail and let me set the 'FROM' attribute?
Regards.
Gregory.
2005 Oct 25 8:17 PM
Oh yes, I forgot about that. You must set the email address of the user which is doing the sending. You can not specify the sender programmically using the function module that you are. I have heard that you can do it if you are using SO_OBJECT_SEND. Which is called inside of the function module that you are using.
Regards,
Rich Heilman
2005 Oct 25 9:00 PM
2005 Oct 26 10:18 PM
I try to use the FM 'SO_OBJECT_SEND' but i dont know which are the paramaters that i have to set to execute it.
Could somebody explain me where i say to the FM the Subject, the sender, the mail body... ???
I hope somebody can helps me.
Thx and rgds.
Grrgory.
2005 Oct 27 5:08 AM
Hi,
Check these links.
http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
Kindly reward points by clicking the star on the left of reply,if it is useful.
2005 Oct 27 2:25 PM
Hey Jayanthi, thx for ur answer. I see the links and try to use the FM, but without success .
Mi issue is that i whant to pass the from address(the mail sender's) to the function.
Best regards.
Gregory.