Running a program and sending its output as an e-mail
In this recipe, we will see how we can create a small program that will run another ABAP program and will send the second program's output as an e-mail attachment in PDF form. The basic steps for creating the send request and defining the recipient will remain the same as mentioned in the previous recipes. This recipe will emphasize on the additional portion required in order to run the program, capture its output, and convert the output into PDF form. The second program (program to be called) is created first and we have named it ZST_6_CALLED_PROGRAM
.
How to do it...
We will now list the steps needed:
We will call the
SUBMIT
statement that will call another programzst_6_called_program
(which simply printsHello World
). TheEXPORTING LIST TO MEMORY AND RETURN
addition is used along with theSUBMIT
statement.Next, we define an internal table based on the dictionary type
abaplist
. We then call theLIST_FROM_MEMORY
function module and use...