2010 Oct 27 10:06 AM
Hello,
My need was to developp a generic program to send ALV result in a Excel file by email (as we have already a program to send any spool in PDF format).
I found package SALV_EXPORT which contains very interesting things.
I have done a program with following selection-screen parameters:
- Name of a program to call
- execution variant linked to this program
- several output options (mail, save as local file, save on application server...)
data: g_guid type guid_32.
data : l_xxml_data type xstring.
g_guid = cl_salv_export_db_storage=>create_guid( ).
export l_mode = 'M' to memory id 'ALV_EXTRACT_MODE'.
export l_guid = g_guid to memory id 'ALV_EXTRACT_GUID'.
* call the program with its variant
submit (p_prog)
using selection-set p_vari
and return.
* Get back the data
l_xxml_data = cl_salv_export_db_storage=>import_xmlstring( guid = g_guid ).
Here, we have a XML data (ALVXML or XML for Excel, i don't know) which is the ALV result with the layout applied (either the alv layout specified on selection-screen of called program or default layout).
This solution is so simple that i wonder that it's not documented (or i haven't found the documentation).
If anybody knows any problem with this solution, has anyu remarks or want to add some enhancement, don't hesitate to post..
Hope this help
Christophe
2010 Dec 09 11:49 PM
A review of comments in ALV driver code shows references to "Mendocino" which I believe is now called 'Duet". It's part of SAP and Microsoft Office integration suite:
http://www.sap.com/solutions/duet/index.epx
I have used this method of extracting ALV reports in the past but I don't think it's released for general use.
Thanks,
Abdul Rouhi
Washington, DC