E-mail through SAP
Hi,
I have used FM SO_NEW_DOCUMENT_ATT_SEND_API1 to mail document. However, this gets stuck in the Outbox. Doesnt reach the destination. Executing the TX - 'SCOT' also doesnt help.
Please help.
Regards,
Ravi
hi,
check this link..
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
for SAPconnect Administration check this..
http://www.sapdevelopment.co.uk/reporting/email/email_sapconnect.htm
Regards
Vijay
Similar Messages
-
Send Mail through SAP WEB Application Server
Hi,
I have configure the SAP Connect and send a short message as a test. The test end with error xs816 Message cannot be transferred to node SMTP due to connection error""Message cannot be transferred to node SMTP due to connection error"
Any suggestion!
ThanksTry the routing test
http://help.sap.com/saphelp_erp2005vp/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
This could tell you the problem,
Regards
Kathirvel -
Payment Advice needs to be send as mail to Vendor through SAP.
Hi,
There is a requirement in my businees related to payment advice mail. After running T-Code: F110, spool getting generated with all the payment advice (lets say 20 advice at a time for different vendor). now we want to mail each advice to respective mail through SAP itself. Could you please provide me some idea through which i can achieve this functionality.
Thank you,
Manya.Please search SDN, you will find all the information already existing on this feature, e.g.:-
[F110 payment advice by e-mail;
Basically BTE event 2040 and 2050 is used for it.
Regards,
Gaurav -
How can I send purchase order through SAP mail ?
How can I send purchase order through SAP mail ? Can any one explain whts the NACE settings?
just do it as <b>Anji reddy</b> said to you ...or else ... in the purchase order trascation ...print it ... so that it will generate the spool request for that purchase order ....
so the the belwo program is for sending <b>the Spool Request data as Email to any Email id ...</b>
The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note for the below program to process a spool request the program must be executed in background otherwise no spool request will be created. Once you have had a look at this there is an modified version of the program which works in both background and foreground. Also see transaction SCOT for SAPConnect administration.
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
* FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
* perform send_email using p_email2.
ENDFORM.
* FORM send_email *
* --> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
* Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
* CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
* If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
* Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
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.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Girish -
E-mail from SAP R/3 to Outlook
Hi,
I am facing issues when attempting to send e-mails from SAP R/3 to Outlook it gives following error. E-mail id of the user id correct but for some reason but I still get these odd error/no message.
There is no resource constraint from SAP R/3 side, I have even seen a case when both the e-mail ids(To & CC) were correct. It failed on CC and TO went successful and visa-versa.
1. When E-mail is erroring out in SOST
Internal error: No Send Order Generated. Error Code:NI_SREQ
Internal error: No Send Order Generated. Error Code:NI_SREQ
Message no. XS829
Diagnosis
An error occurred in program No Send Order Generated. Error Code:NI_SREQ
Error text:
Additional information:
System Response
Message processing terminated.
Procedure
Report the error to the SAP Hotline.
Log :
04/11/2007 10:30:28 Document sent
04/11/2007 10:30:28 Wait for communications service
04/11/2007 10:30:35 Internal error: No Send Order Generated. Error Code:NI_SREQ
04/11/2007 10:30:36 Document deleted from queue
2. When NO STATUS is updated in SAP - SOST.
Recipient Is Valid. Delivery Attempted
Message no. XS718
Diagnosis
The communication system recognized the recipient as valid and will send the message to this recipient, or will generate an appropriate status message if the message cannot be delivered.
System Response
Processing was completed normally.
Additional information on the node used (in the system language of the node, if available):
250 2.1.5 [email protected]
Procedure
No action is necessary.
04/11/2007 11:00:41 Document sent
04/11/2007 11:00:41 Wait for communications service
04/11/2007 11:05:35 Recipient Is Valid. Delivery Attempted
04/11/2007 11:05:35 Document deleted from queue
Appreciate your help in resolving the issue.
Thanks
NaniDefault domain is maintained.
This issue is happening only with few users when they are trying to send a mail through some customized Z t-code.
Recipient ................... Is Valid. Delivery Attempted.
Message XS718.
Pls advice. -
Error in sending mail from SAP to microsoft outlook
Hi all.
Greetings.
I have a requirement to send mail from SAP to Outlook.
SMTP is configured here....i have checked the steps.
I am using FM "SO_NEW_DOCUMENT_SEND_API1" to send the mail text.
when i check the SOST Tcode i got message "Wait for communications service".
after evry 10 minutes the sap connect all process runs..as it is configured in SCOT transaction, but even after 30 minutes the mail is not sent.
I don't know how should i check the error message?
tell me the checking stepls plz?...how should i step through in checking this?
what are the prerequsites for sending mails from SAP to Microsoft outlook?
regards
Prashant Tiwari
Edited by: prashant tiwari on Feb 6, 2009 10:26 AMHi prashant,
Pls refer to the link below:
Re: Inbound Email- SAP Connect
or
check your userid .
If not correct no mail will go from u r id.
Try it with another user id.
or try using the following function module
'SO_NEW_DOCUMENT_ATT_SEND_API1'
I Hope this helps you with the issue.
Thanks
Ravi Aswani -
Hi,
Can one explain me How To send mail to SAP Inbox through externall mail id like abc( at )y a hoo.com to SAP inbox ETC,
IF POSSIBLE PLEASE EXPLAIN in detail. . .
THANKS & REGARDS
Priyanka M JainHi .
Try this it might help you
https://wiki.sdn.sap.com/wiki/display/Basis/SAP%20to%20send%20external%20mails
Re: Unable to send mails from SCOT -
Sample code to send a mail from SAP
Hi guys
could any one provide me with the
sample code to send a mail from SAP with text as the main body of that mail via bcs classesHi,
Please go through this code: U can send mail;
Tables : zchp_cust-info.
DATA: OBJCONT LIKE SOLISTI1 OCCURS 5 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: ENTRIES LIKE SY-TABIX.
DATA: NAME(15).
DATA: CON_NAME(20).
DATA: req_num like zchp_cust_info.
DATA: I_TAB_CHP LIKE ZCHP_CUST_INFO OCCURS 0 WITH HEADER LINE.
*data: reno like ZCHP_CUST_INFO-req_num value .
data input for the mail
select * from zchp_cust_info
appending table i_tab_chp where req_num = c_knumv.
LOOP AT I_TAB_CHP.
concatenate i_tab_chp-created_by i_tab_chp-req_num into CON_NAME.
*WRITE: / con_name.
ENDLOOP.
Fill the document
DOC_CHNG-OBJ_NAME = 'Refe'.
DOC_CHNG-OBJ_DESCR = 'TESCRA Ref Number !'.
DOC_CHNG-SENSITIVTY = 'P'.
*OBJCONT = 'Tescra'.
OBJCONT = CON_NAME.
APPEND OBJCONT.
OBJCONT = con_name.
APPEND OBJCONT.
DESCRIBE TABLE OBJCONT LINES ENTRIES.
READ TABLE OBJCONT INDEX ENTRIES.
DOC_CHNG-DOC_SIZE = ( ENTRIES - 1 ) * 255 + STRLEN( OBJCONT ).
Fill the receiver list
CLEAR RECLIST.
RECLIST-RECEIVER = SY-UNAME. " replace with <login name>
RECLIST-REC_TYPE = 'B'.
RECLIST-EXPRESS = 'X'.
APPEND RECLIST.
CLEAR RECLIST.
RECLIST-RECEIVER = 'sapuser'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
Send the document
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
LOOP AT RECLIST.
IF RECLIST-RECEIVER = SPACE.
NAME = RECLIST-REC_ID.
ELSE.
NAME = RECLIST-RECEIVER.
ENDIF.
IF RECLIST-RETRN_CODE = 0.
WRITE: / NAME, ': succesfully sent'.
ELSE.
WRITE: / NAME, ': error occured'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'Too many receivers specified !'.
WHEN 2.
WRITE: / 'No receiver got the document !'.
WHEN 4.
WRITE: / 'Missing send authority !'.
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'.
ENDCASE.
<b>Please provide points if the issue is solved.</b>
Regards,
Sunil -
Function module to send mail from SAP
Can any one please tell the Function module to send mail from SAP. The scenario is like this,I have a file in local system that i have to send to a particular mail address like [email protected] through a report program.
Hi shafiq,
1. There is some trick involved
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m. -
How to trigger a mail through ALERT CONFIGURATION??
Hi Folks,
I want to know how to trigger a mail through Alert Configuration?
I've read Help.SAP.com, but i am not clear where exactly the sender Email address to be given for sending a mail??
Pls reply..
Thanks in advance..
cheers
ram.Hi,
You need to maintain the email address in SU01 for the particular user Id. Also you need to configure transaction SCOT for this.
Regards,
Jai Shankar -
Problem while sending the mail from sap
Hi experts,
I am facing some problem while sending mail from sap to external mail.
this is th code i am using but it is not working. plz check and tell me.
REPORT ZMAIL_DEMO.
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
break-point.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = 'SOME MAIL ID'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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.
if sy-subrc = 0. "( did not receive any mail) *
write : 'mail sent'.
endif.Hi,
Please check with the following code.
TABLES: KNA1.
data for send function
DATA DOC_DATA LIKE SODOCCHGI1.
DATA OBJECT_ID LIKE SOODK.
DATA OBJCONT LIKE SOLI OCCURS 10 WITH HEADER LINE.
DATA RECEIVER LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
WRITE:/ KNA1-KUNNR, KNA1-ANRED.
send data internal table
CONCATENATE KNA1-KUNNR KNA1-ANRED
INTO OBJCONT-LINE SEPARATED BY SPACE.
APPEND OBJCONT.
ENDSELECT.
insert receiver (sap name)
REFRESH RECEIVER.
CLEAR RECEIVER.
MOVE: 'any_email'_ TO RECEIVER-RECEIVER, " SY-UNAME
'X' TO RECEIVER-EXPRESS,
'U' TO RECEIVER-REC_TYPE.
APPEND RECEIVER.
insert mail description
WRITE 'Sending a mail through abap'
TO DOC_DATA-OBJ_DESCR.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_DATA
IMPORTING
NEW_OBJECT_ID = OBJECT_ID
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECEIVER
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. -
Error while sending mail through SMTP
Hi,
We are getting the following error while trying to send mail through SMTP.
'554 ERROR_MESSAGE_STATE: SMTP_NO_HANDLER( host:1-,subrc:0001)'
Please advice,
Regards,
SamHi All,
Configured SMTP as per the note 455140,i can able to send mails from SAP to the out side world,
mails in SAP.When i tried the test to check whether the SAP system is correctly set up to receive e-mails as per the note 607108, iam getting a connection closed message as below.
afgdev:pgdadm> telnet afgdev 2500
Trying...
Connected to afgdev.
Escape character is '^]'.
220 afgdev.abc.ae SAP 6.40(52) ESMTP service ready
helo afgdev
250 afgdev.abc.ae
mail from:<[email protected]>
250 Ok
rcpt to:<[email protected]>
250 Ok
data
354 Enter mail, end with "."
Hello,This is a test.
Connection closed.
afgdev:pgdadm>
rgds
Sam -
Uncaught Exception occured while sending mail through abap code.
Hi,
Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.HI,
Runtime Error: UNCAUGHT_EXCEPTION details.
Runtime Errors UNCAUGHT_EXCEPTION
Exception CX_ADDRESS_BCS
Short text
An exception occurred that was not caught.
What happened?
The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
the call hierarchy.
Since exceptions represent error situations and this error was not
adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
terminated.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
An exception occurred
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
"SAPLZSEND_MAIL" or "LZSEND_MAILU01"
"ZSEND_EMAIL"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
The exception must either be prevented, caught within proedure
"SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
Please help me to resolve this issue. -
Not recieving mail through FM 'SO_DOCUMENT_SEND_API1'
Hi All,
I am not recieving any mail through the FM 'SO_DOCUMENT_SEND_API1'
Fill the Mailing List.
LOOP AT IT_EMAIL INTO WA_EMAIL.
WA_RECLIST-RECEIVER = WA_EMAIL-EMAIL.
WA_RECLIST-REC_TYPE = 'U'.
APPEND WA_RECLIST TO RECLIST.
ENDLOOP.
Send e-mail to the Global Stock management group.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
SENDER_ADDRESS = sy-uname
SENDER_ADDRESS_TYPE = 'B'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = 'X'
NEW_OBJECT_ID =
SENDER_ID =
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER =
CONTENTS_BIN =
CONTENTS_TXT = OBJTXT
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
RECEIVERS = RECLIST
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
Please provoide helpful pointers.I created a seperate program for this so that I could force the email process to kick off.
Try using this code
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. -
Sending Mail from SAP to External Source
Hi Experts,
We are on ECC 6.0. I have configured the standard SAP system for
sending mails from within SAP to our company mail server. The
mails from SAP are going successfully to our official company
ids, But when i am trying to send mails to outside address like
eg. " email@removed " or " email@removed ", it is not going and
giving an error recipient unknown.
The configuration of SAPConnect is correct because mails are
going successfully to our company id, to send outside do i need
to do something extra???It's Mail Relaying and it allows a mail server to send email (or relay it) on behalf of other systems. Many companies have relaying turned off because it is a security risk.
For example, allowing relaying will allow your system to send an email from xxx.com though your email server which manages emails for company.com. This could be used by a rogue to send spam through your email server.
Also, if you try to send an email from an account that your mail server does not handle some receiving servers may assume it is spam and block it.
For this reason, only allow mail relaying on the email server for your domain and only from the SAP systems. This will prevent abuse from occuring because relaying is enabled.
Have you set the default domain for SAPconnect:
[http://help.sap.com/saphelp_nw04/helpdata/EN/00/7c9962df8111d3a36400a0c943858e/content.htm]
Microsoft note on SMTP Relaying:
[http://support.microsoft.com/kb/304897]
Maybe you are looking for
-
Is it possible to remove the guts of a G4 AGP and put it in a G5 Case?
I really like my G4 PowerMac, but I want to see if it is possible to put a G4 PowerMac AGP parts in a G5 Case. Is it possible? Thanks for any help. I am considering doing this.
-
Help.! Reader will not open
When trying to open Adobe Acrobat Reader 8, it does not open A little window appears and states there was an error opening Adobe Acrobat/Reader. If it is running please exit and try again. (103:103). I have tried uninstalling, reinstalling and upgrad
-
Some Flash Sites are not displayed with Flash Player 9
Hello everyone, After having upgraded to Flash Player 9 I cannot view some flash sites on either FF or IE. I have checked around with other users also and they cannot see them either. Although the page seems to be loading with title etc. it remains b
-
New non-leading ledger creation
Hi, The new non-leading ledger to be created as per the client's requirement. Can we create new non-leading ledger later on. The old data to be posted to new non-leading ledger. Can someone throw light on this issue? What can be done please suggest
-
Constant disconnections and reboots
Over the last couple of weeks, my Homehub 4 seems to be disconnecting and rebooting more frequently than usual. But today it has been happening constantly. It will happen during an incoming or outgoing landline call, but more often it is happening