10-17-2016 1:29 PM
Hello Experts,
I Have written a program to call the data from memory and it is displaying the data in ALV list perfectly.
But I want to disply the data in ALV Grid. Please guide me - how can I do it.
Also Searched on SCN, but failed to find relevant answer.
Thanks in advance.
Dev
report zrich_0003 .
data: begin of listout occurs 0,
line(1024) type c,
end of listout.
* Submit the report and export list to memory
submit zmytesting exporting list to memory and return.
* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.
sort listout DESCENDING.
loop at listout.
write:/ listout.
endloop.
************************************************************************
* RETRIEVE_LIST_FROM_MEMORY
************************************************************************
form retrieve_list_from_memory tables reportlines.
data: list like abaplist occurs 0 with header line.
data: txtlines(1024) type c occurs 0 with header line.
clear list. refresh list.
clear reportlines. refresh reportlines.
call function 'LIST_FROM_MEMORY'
tables
listobject = list
exceptions
not_found = 1
others = 2.
check sy-subrc = 0.
call function 'LIST_TO_ASCI'
tables
listobject = list
listasci = txtlines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
check sy-subrc = 0.
reportlines[] = txtlines[].
call function 'LIST_FREE_MEMORY'.
endform.
10-17-2016 3:47 PM
If zmytesting display some ALV grid, better use class cl_salv_bs_runtime_info to get the data (and layout) back. Else go to splitting the data into columns using all your skill using some split at '|' and code to identify header ignoring statistics and other header data of spool. (or find the sample that existed in a previous version of sdn.)
Regards,
Raymond
10-17-2016 5:01 PM