Submit and Exporting list to Memory

by Diwakar

The function modules "LIST_FROM_MEMORY" and "LIST_TO_ASCI" could be used in this regard.

Sample code:

report zlist_to_memory.

data: begin of t_listout occurs 0,
line(1024) type c,
end of t_listout.

* Submit the report and export list to memory
submit z_reqd_report exporting list to memory
and return.

* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables t_listout.

loop at t_listout.
write:/ t_listout.

* Procedure to retrieve list from memory
form retrieve_list_from_memory tables t_reportop.

data: t_list like abaplist occurs 0 with header line.
data: textlines(1024) type c occurs 0 with header line.

clear t_list. refresh t_list.
clear t_reportop. refresh t_reportop.

call function 'LIST_FROM_MEMORY'
listobject = t_list
not_found = 1
others = 2.

check sy-subrc = 0.

call function 'LIST_TO_ASCI'
listobject = t_list
listasci = textlines
empty_list = 1
list_index_invalid = 2
others = 3.

check sy-subrc = 0.

t_reportop[] = txtlines[].

call function 'LIST_FREE_MEMORY'.



Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image