‎2007 Jun 07 9:45 AM
Hi,
I have a requirement where I need to get the output of a standard report in a Z-report. So, I have used the submit statement exporting list ot memory. When I am trying to read the output using the function module 'LIST_FROM_MEMORY', Iam getting shortdump in the function module.
Please find the below lines of code I am using.
DATA: mem_tab LIKE abaplist OCCURS 100 WITH HEADER LINE.
submit RKATARIF EXPORTING LIST TO MEMORY AND RETURN
with VERSION = '000'
with FROM_PER = '01'
with TO_PER = '12'
with TARIFEH = ' '
with YEAR = sy-datum(4).
CALL FUNCTION 'LIST_FROM_MEMORY' TABLES LISTOBJECT = mem_tab.
Thanks in advance.
Vishnu Priya
‎2007 Jun 07 9:51 AM
HI,
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = mem_tab.
Here MEM_TAB fields shoulb be Charecter type fields, we can not use other than charecter fields in this Function module
*Example Code (Retrieving list from memory)
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.
DATA: BEGIN OF vlist OCCURS 0,
filler1(01) TYPE c,
field1(06) TYPE c,
filler(08) TYPE c,
field2(10) TYPE c,
filler3(01) TYPE c,
field3(10) TYPE c,
filler4(01) TYPE c,
field4(3) TYPE c,
filler5(02) TYPE c,
field5(15) TYPE c,
filler6(02) TYPE c,
field6(30) TYPE c,
filler7(43) TYPE c,
field7(10) TYPE c,
END OF vlist.
SUBMIT zreport EXPORTING LIST TO MEMORY.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.
Regards
Sudheer
‎2007 Jun 07 10:15 AM
Hi,
If the called program output list has other than character fields also, is there no other way we read the output.
Regards,
Vishnu Priya