Email sending program abap




















Email subject, body, recipient email and text for attachment are given in the selection screen. Attachments can be text files, PDF files, world documents etc. Converting attachment string to xstring, converting xstring to SOLIX format and calculating attachment size.

From the early days, I had a passion for coding, software development, and everything tech-related. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world! These are some of the tech gadgets I use every day.

If you make a purchase through these links I will earn a small comission at absolutely no extra cost to you. Hii, do you provide placent opportunities after the training, I am looking forward to someone who can provide me with placement opportunities! Thanks , really helpfull, in the case of needing multiple recipients based on distribution lists or custom roles is there any class or fm to do so? Your email address will not be published.

Frankly there is no way I have the time to do this for all my older, larger blogs. It is looking like the content is gone forever. In our company we have two SMTP servers configured for sending mails. One server for sending mails within the company and the other one for sending external mails.

If somebody knows, please help. Skip to Content. Thomas Jung. September 8, 7 minute read. Based upon these requests, I thought I would pull together some resources and samples on the subject. The setup and samples are quite different on different releases.

This weblog focuses on releases and higher. There are many changes in this release. For one there is no longer any reliance on external executables to send the mail. All samples came from a system.

Much of this configuration may have already been completed by your Basis group. I will just give you a quick check list here without going into all the configuration details provided by this note.

Port 25 is the default. If you have multiple clients in your SAP system, you will want to setup a virtual host for each client. First SCOT has several different views that can be used. One shows the Jobs that have been setup, the other shows setup by routings, etc. This shows a tree with the communication types, the nodes setup for each type and the number of messages in each status.

As of release 46C you have a quite nice Wizard that walks you through the process. However you can also control all settings directly in a dialog maintenance window. This is a screen shot of our Email Node. You can see that to setup this node all we have to do is specify the connection information for an external mail server. In our case we give the host name for our Corporate Microsoft Exchange Server.

Also at this level we can specify the code page that we want all messages converted to before they are sent. You do NOT have to have a Unicode system or kernel to support this functionality. Please refer to OSS Note for the necessary support package levels for this functionality to be complete.

Now lets look at the configuration on our only configured address type: Internet. Next we need to schedule a job that will transmit out E-mails. Normally E-Mails will only go out when this job runs, so you probably want to schedule it quite frequently. Later in my code example, I will show you how using the BCS interface you can send E-mails immediately as well. In our production system we run this job every 5 minutes. The job setup can also be done from SCOT. Switch your view to JOBS. The only other requirement is that the sender of any E-mail, must have their return address setup in their user master.

Also in 46C and higher you have the option to configure the system to generate the sender address on the fly. OSS note gives you the details of this solution. I like to start by testing using the SAP short message functionality. From here we will prepare a short test message.

You should receive your test message if everything is setup fine. Where do we start trouble shooting? Once again start with the transaction SCOT. The system status shows us our status overview. You can see the number of messages in Error or Waiting.

The overview screen is nice, but you probably want more details. This transaction will give a detailed report by Address type, status, date, time and sender. For each message we can view the transmission history, the message itself, and the trace log. You can also try and resubmit the message from here. If you need to activate tracing, you want to return to transaction SCOT. You can also view all traces from here without having to go through SOST. The example I am going to share with you is actually a function module that we wrote.

We wanted to write a function module that would really simplify the process of sending E-mail for our newer ABAP developers. We wanted them to just specify a few parameters and be off and running without having to understand the BCS classes. Hopefully you will find this function module helpful as well as being a good tutorial on how to use the BCS classes.

The first is an optional parameter used to set what requested statuses types will be returned. The second parameter is an internal table that will hold all of our document parts. The following is the line type that defines this internal table type: The first entry in this table will become our E-Mail Body.

All other parts will become attachments in the email. For each record in this table you must specify the document type as a value defined in the foreign key table TSOTD. You can also supply the subject line or attachment name in the subject field. You will notice that the structure of these two content areas match those used by the API function modules in 46D and lower.

The third parameter is another internal table that will hold all of our recipients. Finally there are several flags that can be set per recipient such as No Forward, Express Message, etc. The function module has no Exporting, Changing, or table parameters. Alert Moderator. Alerting is not available for unauthorized users. Assigned Tags. Similar Blog Posts. Related Questions. You must be Logged on to comment or reply to a post. Former Member.

I have a problem since we migrated our system to microsoft and applied unicode coding standards. This no longer works, when trying to open the attachment it displays the message "invalid type".

Thanks Kev B. Like 0 Share. Right click and copy the link to share this comment. Thomas Jung Blog Post Author. How are you building the attachment content? Hi Thomas, Thanks for this very useful info!

I'm not sure I understand your question. Let me put it in detail. Thanks Vinoth. If you use the send immediately option more of the processing steps will occur within the sending program instead of in batch and you can catch more exceptions.

Thanks for your reply. Thanks a lot for this Blog it help me a lot Best regards Mathias. Check the logs in SCOT for more details. Hi Thomas, thanks. Thanks - Abdul I want to change the Sender name and Email id. How can i achieve this? The easiest way if you are basis release 6. Hello, Can-you help me?

I don't have all the error codes memorized so I wouldn't know off hand what is. Excuse me. You can't do send immediately with the old Function Module based interface. I solved my problem with your help. Theresa Hayes. Thomas, Excellent blog! Thanks, Teri. I didn't see anything in the BCS classes to allow for this.

Your question doesn't really seem directly related to this blog. Hello, I tried sending an email with PDF attachment. What is the logon language used to send the email? Hi Thomas, Thanks for your quick reply. How are you building the CSV document? Yes, i'm concatenating the fileds and texts separated by semicolon and finally passing the line to internal table and then conversion to Binary.

Have you tried adding a BOM? You can attach a BOM to the front of any binary content. Hi, I am facing the same issue Hi, Within Few days I am facing problem in the Smartform data in the form of excel file attached in the mail. We are using ECC6 system. Regards, Amit Gupta. Hi Thomas , Thanks for replying and guiding me.

Examples are shown above in the Blog. That's fine, but you still haven't said what you need help with? Hi Thomas, Thanks for the quick reply Thank you! Prabhjot Bhatia. You can try to integrate in your program. Like 1 Share. Mark Wagener. Hi, nice blog! Best regards, Mark. Stop using Hungarian notation! I have tried following two ways. But still it is not working 1. Could you please help me out, how can i resolve my issue. Thanks in advance. Best Regards, Jagadeesh. Hi Jagadeesh, You will have to check this with your BASIS colleagues, as this sometimes occurs due to insufficient resources on the application server.

In case, you find any other solution or reason, please help us all with that as well. Thanks and Regards, Mohit Sharma. Andy Pataselano. Hi Mohit, Thank you for nice blog. Could you give advice for solve this problem? Best regards, Andy Pataselano. Regards, Mohit Sharma. Hi Mohit, 'Reply To' is not same as recipients. Link Text. Open link in a new tab. No search term specified.



0コメント

  • 1000 / 1000