2005 Mar 22 8:18 AM
Hi all,
I'm a newbie in SDC and try to implement the following functionality (Version 4.0B):
A ABAP report (to be scheduled as e.g. a daily job run) with ALV output should send an automated email containing the ALV informations to a receiver specified in the selection criterias.
I already have the following pieces:
1) The report with ALV output (running online and clicking on List/send/office works perfectly, the alv-output is attached to the mail). The report runs also in background and generates a spool.
2) A subroutine wich sends a email (input has to be in an itab)
Now I try to put them together.
Question: How can I automate the send process?
I did a little bit of debugging, but got lost in the SAP Office functions.
Any help appreciated!
Thomas
Hi all,
I'm a newbie in SDC and try to implement the following functionality (Version 4.0B):
A ABAP report (to be scheduled as e.g. a daily job run) with ALV output should send an automated email containing the ALV informations to a receiver specified in the selection criterias.
I already have the following pieces:
1) The report with ALV output (running online and clicking on List/send/office works perfectly, the alv-output is attached to the mail). The report runs also in background and generates a spool.
2) A subroutine wich sends a email (input has to be in an itab)
Now I try to put them together.
Question: How can I automate the send process?
I did a little bit of debugging, but got lost in the SAP Office functions.
Any help appreciated!
Thomas
2005 Mar 22 12:14 PM
Hi Thomas,
One option is not to bother coding this in your ABAP. If you are going to schedule this job via SM36 you can set a SAP Office recipient for the job output. This will send the list attachment to SAP office. If you have SCOT correctly configured then the mail should get placed into SCOT for transmission to external mail systems.
To me this is a bit of an easy/standard work around if you don't need a more complex solution.
Of course there are many other methods that others may wish to discuss.
Michael
2005 Mar 22 1:07 PM
Hi Michael,
Thanks a lot! This works also with an external (internet) email adress, which is exactely what I want.
Somtimes standard is just to easy to think of:).
Now I just have to find a way to adjust the subject line and/or the mail text. I'm working on that. If you have any suggestion...
Kind regards,
Thomas
2005 Mar 23 12:05 AM
Hi Thomas,
That's were the requirements probabaly become the "more complex" requirements that I mentioned in my previous reply.
I must admit I'm not sure if you can do this without coding the sending procedure in your ABAP. Of course, then you can add mail text and set the heading of the mail.
Thomas Jung wrote, as usual, some excellent weblogs on sending mails from within ABAP code.
Regards,
Michael
2005 Mar 23 6:25 PM
Hi Michael,
thank you again a helpfull reply. To solve the issue I ended up writing a second little report.
Here is a short description of my solution just in case anybody else is also interested in.
I set up a Job with two steps.
Step 1 is the ABAP that creates e.g. a ALV output (anything that goes to spool).
Step 2 is a little ABAP that does nothing else than reading the output of step 1 (Spool) and send it as SAP Office Document. (To be a little more flexible I added some selection criterias for step 2 like Jobstep number, receiver, sendmode, ...).
It works fine online (by keying in the spool number manually) and in batch mode (by determining the spool number based on the job number). I think this solution is flexible and lightwight.
Kind regards,
Thomas
Message was edited by: Thomas Hager
Message was edited by: Thomas Hager