‎2007 Jan 27 12:40 PM
Hi,
i need to display an ouput by submitting a standard report and getting the data from memory using <b>LIST_FROM_MEMORY</b>. After capturing data in itab. I want filter data based on some condition and after wards i want to display that itab data in ALV list and if download to pc check box is checked, need to download it to pc file in excel format. This what i need to do
i've searched forum for clarification on SUBMIT and i found the following facts
1. if its an ALV LIST (and not grid)
then we can get the data.
2. moreover,
the data will be raw data.
We will not be able to extract information
from it.
3. It will be exactly in the same format
as it is printed,
(ie. with headings, vertical lines, etc)
Can anybody explain the above said all are true and if so explain 2nd and 3rd points with an example.
can we use LIST_FREE_MEMORY and TABLE_COMPRESS to free memory and to compress the table??
What is the need to compress the table?
I will be greatful if any body pen the answers for the above Qs..
Thanks
Praneet
Message was edited by:
Praneet
‎2007 Jan 27 10:27 PM
Hi Praneet,
you have the possibility of affecting Lists in Called Programs Locate the document in its SAP Library structure
When you call an ABAP program, you can modify its lists, send them to a spool file instead of the screen, or store them in ABAP memory.
Modifying the List Structure
You can modify the list structure of a called program by using the following additions in the SUBMIT statement:
If the called program contains no such options in the REPORT statement, the system formats the lists of the called program according to the options in the SUBMIT statement. If, on the other hand, the REPORT statement in the called program does specify a list structure, the additions in the SUBMIT statement are ignored.
Printing Lists
You can send a list from a called program directly to the spool system instead of displaying it on the screen. To do this, use the TO SAP-SPOOL addition in the SUBMIT statement:
SUBMIT... TO SAP-SPOOL print-parameters.
For details of the parameters that you can use here, refer to Printing Lists.
Saving Lists
You can store a list from a called program in the ABAP memory instead of displaying it on the screen. To do this, use the EXPORTING LIST TO MEMORY addition in the SUBMIT statement:
SUBMIT... AND RETURN
EXPORTING LIST TO MEMORY.
This statement stores the list in ABAP memory, allowing the calling program to access it once the called program has finished. You must use the AND RETURN addition in this case. You cannot use the additions EXPORTING LIST TO MEMORYand TO SAP-SPOOL together.
The function group SLST provides function modules for accessing the saved list, including for example:
· LIST_FROM_MEMORY
· WRITE_LIST
· DISPLAY_LIST
The data retrieved from LIST_FROM_MEMORY are in LISTOBJECT format. You can extract data from this in various ways:
FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
or
FUNCTION 'LIST_TO_ASCI'
are just two methods.
Regards,
Clemens
‎2007 Jan 28 7:30 AM
Hi Li,
As per your reply i can extract data in to an itab using LIST_FROM_MEMORY.
1. I need to add two more fields to that itab from the calling from program and i've to display that itab to ALV LIST.
2. I have one more requirement if i select 'Download to pc file' Option check box at selection screen of calling program, the list ouptut has to be downloaded to an excel file.
My Question is for the above said two requirements is LIST_FROM_MEMORY is enough to extract to an itab (for ALV display and download to excel)?
Do I need to use LIST_TO_ASCI? if i dont use this one is it not possible for ALV display or excel download?
Will be waiting for your reply..
Regards,
Praneeth
‎2007 Jan 28 2:02 PM
Praneet,
I think you never need LIST_FREE_MEMORY and TABLE_COMPRESS - to answer your initial question.
I don't know what the list looks like in your case. Probably it will help to use LIST_TO_ASCI because this will remove formatting information not useful at this step.
The you will have to extract the data and transfer them to an internal table of your custom structure - including the filling of any additional fields. To display that itab to ALV LIST you need the appropriate field catalog. Also, keep in mind that all values in the list are in output format making it necessary in some cases to convert to internal format.
For the download option: Use GUI_DOWNLOAD, process it with END_OF_LIST request.
Start with the SUBMIT and LIST_FROM_MEMORY. Use debugger to see the difference with LIST_TO_ASCI. Finish your ALV output. You can start a performance analysis and do the SYSTEM->LIST->DOWNLOAD. In the analysis check the function modules used for the download. You will find millions of samples for download in this forum.
Regards,
Clemens