Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV: Send ALV output as mail - background processing

Former Member
0 Likes
2,694

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

4 REPLIES 4
Read only

michael_bennett1
Explorer
0 Likes
1,014

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

Read only

0 Likes
1,014

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

Read only

0 Likes
1,014

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

Read only

0 Likes
1,014

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