‎2007 May 07 6:19 PM
Hi All,
I want to save a report output and export it to a unix file. However, I don't want to use Submit.....Exporting_List_To_Memory... I want to use <b>LIST_TO_MEMORY</b>. Could someone giving me a short working example of how I would use this function correctly? Thank you in advance,
Jim
‎2007 May 07 6:39 PM
HEre is a pretty simply example.
report zrich_0001.
data: ilist type table of abaplist with header line.
data: istr type table of string with header line.
start-of-selection.
do 10 times.
write:/ sy-index.
enddo.
call function 'LIST_TO_MEMORY'
exporting
list_index = 0
tables
listobject = ilist
exceptions
empty_list = 1.
call function 'LIST_FROM_MEMORY'
tables
listobject = ilist.
call function 'LIST_TO_ASCI'
tables
listasci = istr
listobject = ilist
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
skip 5.
write:/ 'The following has been pulled from memory'.
loop at istr.
write:/ istr.
endloop.
Regards,
Rich Heilman
‎2007 May 07 6:39 PM
HEre is a pretty simply example.
report zrich_0001.
data: ilist type table of abaplist with header line.
data: istr type table of string with header line.
start-of-selection.
do 10 times.
write:/ sy-index.
enddo.
call function 'LIST_TO_MEMORY'
exporting
list_index = 0
tables
listobject = ilist
exceptions
empty_list = 1.
call function 'LIST_FROM_MEMORY'
tables
listobject = ilist.
call function 'LIST_TO_ASCI'
tables
listasci = istr
listobject = ilist
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
skip 5.
write:/ 'The following has been pulled from memory'.
loop at istr.
write:/ istr.
endloop.
Regards,
Rich Heilman
‎2007 May 07 7:06 PM
Hi Rich,
Thanks, but the function <b>'LIST_TO_ASCI'
tables
listasci = istr
listobject = ilist
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.</b>
gives me an ABAP dump on the <b>istr</b> object - any idea why?
Jim
‎2007 May 07 7:16 PM
‎2007 May 07 7:20 PM
Rich,
I substituted an explicit internal table declaration for the istr table, i.e.,
data: begin of istr with header line,
line(1024),
end of istr.
This worked fine - thanks again and I the points will be rewarded.
Jim
‎2007 May 07 7:21 PM
Hi Jim,
Please try to replace this line.
DATA: ISTR TYPE TABLE OF STRING WITH HEADER LINE.
with this line.
DATA: ISTR TYPE TABLE OF LISTZEILE WITH HEADER LINE.
Regards,
Ferry Lianto