Google Search - Blog...........

ABAP - Working With List Memory

report ztest .

data: it_ascilines type char255 occurs 0 with header line,
it_list type table of abaplist with header line,
it_msg type table of soli initial size 0 with header line.

*---start of selection
start-of-selection.

*--output of the list.
do 10 times.
write:/ sy-index.
enddo.
*----saving this list to memory
call function 'SAVE_LIST'
tables
listobject = it_list
exceptions
list_index_invalid = 1
others = 2 .

*----retriving list from memory
call function 'LIST_TO_ASCI'
tables
listobject = it_list
listasci = it_ascilines
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.

check sy-subrc = 0.
it_msg[] = it_ascilines[].

*---displaying the list retrived from memory
loop at it_msg.
write:/ it_msg-line.
endloop.

the output is like this:

No comments:

Post a Comment