ABAP program for sending emails
Hello SAP developers,
I need ABAP program for sending emails to my internet adress in background - just some simple header with no body and no attachement. Recipient should be specified due the parameter etc... Does program like this exist or i have to create it? I am not familiar with ABAP. I am basis admin so I am little bit lost in this. I have tried program code from this page ->
http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm
But anyway it does not work - there is an exception "no message send". SCOT is configured, mails are working fine from transaction SBWP.
Thanks in advace
JM
I have already solved my issue through CCMS agents and RZ20 central autoreaction (sms) in Solution Manager.
Regards
JM
Similar Messages
-
Servlet for sending email error
i working for send email using servlet and html. when i run i got this error..
what cause this problem.
please someone help me. urgent!!!
thank you in advance
servlet error........
ENCOUNTERED EXCEPTION: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
at EmailSMSServlet.doPost(EmailSMSServlet.java:123)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)here is my code...actually my program send email from SMS. i parser SMS to email format. My SMS part is working but when i combine it,i got error as above. I tried run without servlet (using command prompt) it working properly and i can send email.
public class EmailSMSServlet extends HttpServlet
CService srv;
int status;
LinkedList msgList;
public void init(ServletConfig config) throws ServletException {
super.init(config);
srv = new CService("com4", 9600);
msgList = new LinkedList();
srv.initialize();
srv.setCacheDir(".\\");
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException
PrintWriter writer = response.getWriter();
response.setContentType("text/html");
writer.println("<html>");
writer.println("<head>");
writer.println("<title>SMS TO EMAIL</title>");
writer.println("</head>");
writer.println("<body bgcolor=\"blue\">");
writer.println("test");
try
status = srv.connect();
if (status == CService.ERR_OK)
srv.setOperationMode(CService.MODE_PDU);
if(srv.readMessages(msgList,CIncomingMessage.CLASS_ALL)==CService.ERR_OK)
for (int i = 0; i < msgList.size(); i ++)
CIncomingMessage msg =(CIncomingMessage)msgList.get(i);
String s=msg.getText();
String from1=msg.getOriginator()+"@mysite.bla.bla";
writer.println(s);
writer.println("<p>");
writer.println(from1);
writer.println("<p>");
// parser sms to email ...
String delim = "#";
StringTokenizer st= new StringTokenizer(s,delim);
String str[] = new String[st.countTokens()];
int j=0;
while (st.hasMoreTokens())
str[j++] = st.nextToken();
writer.println("<p>");
writer.println("Kepada:");
writer.println(str[0]);
for(int k = 0; k < str.length; k++)
writer.println(str[k]);
// Send mail using javamail.....
Properties props=new Properties();
props.put("mail.transport.default",blah");
props.put("mail.smtp.host","blah");
try{
Properties props=new Properties();
props.put("mail.transport.default","smtp");
props.put("mail.smtp.host","host");
Session mailSession=Session.getInstance(props,null);
Message mssg=new MimeMessage(mailSession);
mssg.setSubject(str[1]);
mssg.setContent(str[2],"text/plain");
Address to =new InternetAddress(str[0]);
mssg.setRecipient(Message.RecipientType.TO,to);
Address from=new InternetAddress(from1);
mssg.setFrom(from);
Transport.send(mssg);
writer.println("Succes");
} catch (Throwable t) {
writer.println("<font color=\"red\">");
writer.println("ENCOUNTERED EXCEPTION: " + t);
writer.println("<pre>");
t.printStackTrace(writer);
writer.println("</pre>");
writer.println("</font>");
srv.disconnect();
else
writer.println("Connection to mobile failed, error: " + status);
catch (Exception e)
e.printStackTrace();
writer.println("<br><br>");
writer.println("</body>");
writer.println("</html>");
thanks -
Components required for sending Email from SAP [Kernel Release 46D]?
Hi All,
Can somebody please tell me the components and the Configuration settings required for sending Emails from SAP system[Kernel Release 46D] to the mail server[Win NT] using SMTP.
From note 455127, I understood that "Sap Internet Mail Gateway" is required and there are other settings to be done. (SAPconnect with RFC can only be used as the Kernel version is 46D)
It will be great if somebody can explain me in simple steps if He/She has done this before.
Thanks,
VarunVarun,
sendmail comes with UNIX OS, there are versions of sendmail programs available for Windows too, but i guess you have to purchase them.
Another alternative is a discontinued product called SAP Exchange connector, if you have a Windows environment and MS Exchange server as your mail server, you could use a SAP exchange connector and get your SAP Email config done.
Regards,
Siddhesh -
An advanced solution for sending email from Solution Manager (or CRM)
Hi all,
did anyone use blog "An advanced solution for sending email from Solution Manager (or CRM)"
<a href="/people/emmanuele.prudenzano/blog/2006/08/03/an-advanced-solution-for-sending-email-from-solution-manager-or-crm:///people/emmanuele.prudenzano/blog/2006/08/03/an-advanced-solution-for-sending-email-from-solution-manager-or-crm
I´ve got some problems:
I tried to implement your solution in our SAP system. I´m new to ABAP and so it´s a little bit try and error for me.
I´ve got some errors:
In method EXEC_SMART_FORM_WITH_TEXT (from note 935670) :
- method string_to_soli does not exist. There is a method xstring_to_solix.
When I change to method xstring_to_solix
- "L_STRING" is not type-compatibly to "IP_XSTRING".
In method ZSM_ATTACH_PHIO_DOCU:
- field DOCUMENT is unknown
Regadrs
AndyHi all,
did anyone use blog "An advanced solution for sending email from Solution Manager (or CRM)"
<a href="/people/emmanuele.prudenzano/blog/2006/08/03/an-advanced-solution-for-sending-email-from-solution-manager-or-crm:///people/emmanuele.prudenzano/blog/2006/08/03/an-advanced-solution-for-sending-email-from-solution-manager-or-crm
I´ve got some problems:
I tried to implement your solution in our SAP system. I´m new to ABAP and so it´s a little bit try and error for me.
I´ve got some errors:
In method EXEC_SMART_FORM_WITH_TEXT (from note 935670) :
- method string_to_soli does not exist. There is a method xstring_to_solix.
When I change to method xstring_to_solix
- "L_STRING" is not type-compatibly to "IP_XSTRING".
In method ZSM_ATTACH_PHIO_DOCU:
- field DOCUMENT is unknown
Regadrs
Andy -
How to read a word in a abap program for syntax check
program for finding keywords:
into a given program name in selection screen.
e.g Parameters Keyword in YXABC propgram.
How to find a word in a abap program for syntax checkHi!
Read table TNAPR for the program names.
Then use the READ REPORT statement for it and load the program into an internal table.
Then loop at the table.
Regards
Tamá -
Function module for sending email
Hi all,
Can I know list of function modules for sending emails.
Other than "SO_DOCUMENT_SEND_API1"
pls let me knowHi Praveen,
Below is the sample code to send the external mail.
&**********Reward Points if helpful**********&
DATA: ld_mtitle LIKE sodocchgi1-obj_descr,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des .
ld_receiver LIKE sy-subrc.
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c, "#EC NEEDED
w_doc_data LIKE sodocchgi1.
REFRESH it_receivers . CLEAR it_receivers .
IF v_trip_send = 'X'.
it_receivers-receiver = it_trip_dload-approver_email .
ELSE .
it_receivers-receiver = it_adv_dload-approver_email .
ENDIF.
it_receivers-rec_type = c_u .
APPEND it_receivers. CLEAR it_receivers.
it_receivers-receiver = " ------> pass your reciever email id.
IF v_trip_send = 'X' .
it_receivers-receiver = it_trip_dload-requester_email .
ELSE .
it_receivers-receiver = it_adv_dload-requester_email .
ENDIF .
it_receivers-rec_type = c_u .
it_receivers-copy = 'X' .
APPEND it_receivers. CLEAR it_receivers.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
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 = c_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 = c_saprpt.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = c_f.
CLEAR it_attachment.
REFRESH it_attachment.
it_attachment[] = it_attach[].
Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = c_raw.
APPEND it_packing_list.
Create attachment notification
it_packing_list-transf_bin = c_x.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = ld_format.
it_packing_list-obj_descr = ld_attdescription.
it_packing_list-obj_name = ld_attfilename.
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = it_packing_list
contents_bin = it_attachment
contents_txt = it_message
receivers = it_receivers. -
ABAP Program for Processchain..
I have one processchain that is running my manually.
if processchain running means need a output like processchain running.if processchain not running/completed
i need a output like process completed.so finaly i need to develop abap program for my processchain.any one write program for my processchain?Hi,
REPORT ZPROCESSCHAINLOG.
TABLES rspclogchain.
DATA: gt_rspclogchain LIKE rspclogchain OCCURS 0,
wa_rspclogchain LIKE rspclogchain.
DATA: gt_log LIKE rspc_s_msg OCCURS 0,
wa_log LIKE rspc_s_msg,
log type c.
SELECT * FROM rspclogchain
INTO CORRESPONDING FIELDS OF TABLE gt_rspclogchain
WHERE datum eq sy-datum
AND chain_id = YOUR PROCESSCHAINID.
IF sy-subrc = 0.
SORT gt_rspclogchain BY datum DESCENDING
zeit DESCENDING.
READ TABLE gt_rspclogchain
INTO wa_rspclogchain INDEX 1.
CALL FUNCTION 'RSPC_API_CHAIN_GET_LOG'
EXPORTING
i_chain = wa_rspclogchain-chain_id
i_logid = wa_rspclogchain-log_id
TABLES
e_t_log = gt_log.
IF sy-subrc = 0.
LOOP AT gt_log INTO wa_log.
if wa_log-msgv4 = 'Successfully completed'.
log = 1 .
endif.
ENDLOOP.
if log = 1.
WRITE: / 'Processchain completed'.
ELSE.
WRITE :/ 'processchain is running'.
endif.
ELSEIF sy-subrc <> 0.
WRITE :/ 'Not scheduled'.
endif.
endif.
Best Regards,
Thangesh -
ABAP program for wage type variant report
Hi experts,
plz any one sen me the ABAP program for to create wage type variant report plz.
Thanks
Rajesh.Requesting for code is against forum rules. Please read the rules of the forum before posting.
-
ABAP programing for off-cycle payment for bonus
Hi Guru's
I have to develop a ABAP program for Off-cycle payment bonus,
I am new, any one can help me in this.Hai,
Please refer to the given below link:
back payment for off-cycle bonus -
ABAP program for BAPI and convert DB into XML
ABAP program for BAPI and convert DB into XML
Thank you,
Regards,
Jagrut BharatKumar ShuklaRefer the link -
give an example of bapi coding?
how can we transfer huge amount of data from database server to xml format
Regards,
Amit
Reward all helpful replies. -
How to create a BO for sending emails
Hi All,
I want to create a Business Object which should have an event for sending emails.
Please guide me on this.
Thanks in Advance,
Saket.Hi Raj,
See i will explain why i want it.In the link it's done as below:
IF ZCUST_INFO-COUNTRY = 'IN'.
DATA: W_OBJTYPE TYPE SWETYPECOU-OBJTYPE,
W_OBJKEY TYPE SWEINSTCOU-OBJKEY,
W_EVENT TYPE SWETYPECOU-EVENT.
W_OBJTYPE = 'YH355_BO'.
W_OBJKEY = ZCUST_INFO-CUSTNO.
W_EVENT = 'SENDEMAIL'.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = W_OBJTYPE
objkey = W_OBJKEY
event = W_EVENT
COMMIT WORK.
ENDIF.
But here w_objtype is a custom BO and also w_event = 'SENDEMAIL' .This event too
is a custom event.
Now i want to know what code is there in this custom BO because it is this BO which triggers the email through SENDEMAIL event.
Hope i am clear here.
waiting for your reply. -
Setting default account for sending email
I have 4 accounts I use for sending email, but would like to have one be the default and can't figure how to do that. there is a check box next to the outgoing server dropdown that says use only this account. I don't think that is what I want, nor am i clear what that would do.
Is there a way to set a preferred outgoing account?
Does that require a plug in or helper app of some sort.
thanks for any suggestions.In Mail>Preferences>Composing:
Use Send new messages from: to select an account. -
SAPCONNECT guide for sending Emails from BW System to Individual Email IDs
Hello Everybody,
If somebody can send me a pdf guide for SAPCONNECT inorder to configure Information Broadcasting in SAP BW for sending Emails to user's mail Id from BW system i will reward points to the helper for same if the help found useful as iam struggling for a pdf guide since long but couldnot find one ,not even over google,i dont need help site links ,i have tried them already ,they dont lay the exact procedure ,but a pdf guide ,my email id is [email protected] .
Regards,
SaumyaHello Vikash,
Plz check i have rewarded you points for this forum under very helpful answers.Kindly now plz help me with this matter:
I got ur document ,it was very helpful.Actually though i have already done most of these steps but i did all these steps all over again.Have u already made configuration for BW Information Broadcasting on your side because although i have done all these steps but wt happens is that the mails get collected in the SOST transaction and iam still not able to send mails and the error displayed is as :
Message cannot be transferred to node SMTP due to Connection Error .
Kindly please revert back to this error at earliest.
Regards,
saumya -
Settings on Microsoft Exchange Server for sending Email from BW to emailid
Hello Everybody,
I wanted to know that for sending Email from SAP System (that is via Information broadcasting feature of BW )to Email IDS of individuals do we need to make any configurations on Exchange Server as well or some RFC between Microsoft Exchange Server and BW .I have made all settings for SMTP through SCOT transaction but still not able to send mails.From our Exchange Server,the connector is removed ,do we need to reconnect it for this purpose.kindly please tell me wt all configurations do i need to make on Mail server for sending Emails as iam not able to do the same now.If somebody can send a PDF/Word document in support for the same on my email Id [email protected] ,i shall be highly obliged.Your help shall be appreciated ,kindly revert at earliest.
Regards,
saumyaHi Somya,
Looks like you are deep into Information Broadcasting. I am sure you must have seen this, still sharing with you -
SAP Notes -
875136 - Node ID is missing in the status message for RFC connection
455140 - Configuration E-mail, fax, paging/SMS via SMTP
regards
Vikash -
Help in Function Module for Sending Email to Supplier afetr Registration
Hi Team
I am beginner in ABAP, need your help in finding solution for the below issue.The Scenario is between MDM to SRM(R/3 System)
External supplier when registers, system need to generate a unique identification number ( Registration Number / Profile Number ) for the supplier and also generate a PIN ( password ) for the Registration Number, so that users from supplier company can request a user id to be created.These user idu2019s will be then linked to the supplier profile using the registration number.Also, supplier needs to be communicated with the Registration and PIN number via email.
FOr the email we are using the FM"ZGVMP_SUPPLIER_REGISTRATION".
My query is when the supplier is receiving the email , he is getting the email from the name GVMPUIDC(i.e the system id, it is being sent by the syetm id or user id of the program).
I want the mail to be sent by the following name to the supplier by different name instead of GVMPUIDC.
please help in solving the problem
Thanks
Edited by: VArjun86 on Dec 5, 2011 11:12 AMHi Kesshav
The FM which i am using is zgvmp_supplier_registration..
Below is the code which is being used to send the emails.
Send emails to Registration from Suppliers only
if not wa_contact-name1 is initial and
not wa_contact-name2 is initial.
if sy-sysid = 'NSP'.
perform send_email.
else.
perform send_html_email.
endif.
endif.
please let me know if you require any more details
Maybe you are looking for
-
Install New OS via PCmcia CD ROM on Portege 3110CT
Hi there , I really hope someone can help me as I am going out of my mind trying to install a new OS on my Portege 3110CT So far I have tried Windows 98, 98SE and 2000, I can get them all to install via a dos driver for the PCMCIA card I found but it
-
How do I disable the sound effect on my MacBook Air when adjusting the volume
how do I disable the sound effect on my MacBook Air when adjusting the volume
-
Can you use anchors with tabbed panels???
Im trying to use anchors with tabbed panels but they dont seem to work. I need to be able to link to specific tabs and specific areas within those tabs, but I haven't been able to find a way to do this. Does anyone know or have a work around?
-
I have a link created in DreamWeaver that directs the public to a pdf file. Once the form is completed and the hit the submit button it is then sent via email in the fdf format. I have one user you can not open the attachments once they have received
-
Since I upgraded to iphoto 11, I have not be able to access my photos without the program locking up, not respondiong, and shutting down. iphoto has went into repair on its own, but still shuts down. I have sent in reports each time, but have not f