Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 

Recently, have come across a requirement to send output of report developed based on SALV as an excel attachment. To achieve the same we can use the method TO_XML of class CL_SALV_TABLE. This method will have the formatted output content as XSTRING value.

Here are the steps.

a. Variable Declaration.

b.Data Selection/ALV Customizing calls.

c.Call to Convert ALV Output as internal XML Format.

d.E-Mail Data Declaration.

e.EMail - Content Conversion/Body/Attachment Creation

Send E-Mail

Excel Output

we can also use TO_XML method to download the content as an XLS or XML documents  in Abap Web dynpro based applications .

Here is the sample source code for this approach.