‎2005 Dec 01 6:10 PM
Hi there,
I want so make a submit in a program that is a report write, so, I want to get this data from the spool or the memory, but I don't know how to do it.
Thanks!!!
Alexandre Nogueira.
‎2005 Dec 01 6:11 PM
Here is a little sample....
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 z_your_report exporting list to memory
and return.
* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.
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.
Regards,
Rich Heilman
‎2005 Dec 01 6:11 PM
Here is a little sample....
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 z_your_report exporting list to memory
and return.
* Get list from memory and convert to ascii
perform retrieve_list_from_memory tables listout.
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.
Regards,
Rich Heilman
‎2005 Dec 01 6:12 PM
DO 10 TIMES.
WRITE : / sy-index.
ENDDO.
The Calling Program.....
REPORT ztest2 LINE-SIZE 255.
SUBMIT ztest EXPORTING LIST TO MEMORY AND RETURN.
DATA : listtable LIKE abaplist OCCURS 0.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listtable
EXCEPTIONS
not_found = 1
OTHERS = 2.
‎2005 Dec 01 6:15 PM
Thank you,
It's solved now!
Alexandre Nogueira
The points are awarded
‎2005 Dec 01 6:14 PM
Hi
Did you say report or report writter ?
If it is report then you can use this syntax.
SUBMIT PROGRAMNAME AND RETURN EXPORTING LIST TO MEMORY .
Use FM LIST_FROM_MEMORY to read the output list and then FM LIST_TO_ASCI to convert .
Use FM LIST_FREE_MEMORY to free the saved list.
Regards
Kalpana