‎2006 Nov 21 6:15 AM
Hi!
i wonder why the <b>FM 'LIST_FROM_MEMORY' </b> raise error NOT_FOUND.
function LIST_FROM_MEMORY.
import LISTOBJECT from memory id '%_LIST'.
if SY-SUBRC <> 0.
-> raise NOT_FOUND.
endif.
endfunction.
my code to convert abap report to excel file is as below. It works fine when execute on frontend, but error exist when execute as background job.
pls help...
thanks
* get all variants entered in the selection screen and store in seltab
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
CURR_REPORT = 'ZTEST'
TABLES
SELECTION_TABLE = seltab.
* submit this report with seltab and export to memory
SUBMIT ZTEST with SELECTION-TABLE seltab
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = abaplist. " <- Error above exists when execute this FM
* convert abap report to ASCII and later convert to excel file
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1
TABLES
LISTASCI = record
LISTOBJECT = abaplist.
‎2006 Nov 21 3:18 PM
You aren't catching the error. Call the FM like this:
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = abaplist
<b>EXCEPTIONS
not_found = 1.</b>
IF sy-subrc <> 0.
*No list to process.
ENDIF.
Rob
‎2006 Nov 21 10:51 AM
Hi,
try to submit your report "normal"
..with bukrs = p_bukrs ...
2) how do you defined "abaplist" ?
A.
‎2006 Nov 21 10:58 AM
Hi huai,
1. I tried just now
2. this error will come if
the program (which was submitted)
did not print/display anything in the output.
3. so in your program, ZTEST ,
first, for testing purpose,
just print a test matter 'HELLO'
(without any if condition)
4. Then check this FM. it will work fine.
regards,
amit m.
‎2006 Nov 21 11:05 AM
Huai Ying Tan ,
if your submit program didn't give any report then obviously it will give the same error.
the problem with your submit.
SUBMIT ZTEST with SELECTION-TABLE seltab
EXPORTING LIST TO MEMORY
AND RETURN.
check the seltab values.
Regards
Vijay
‎2006 Nov 21 11:12 AM
hi
good
go through these links, i hope these ll give you good idea abou the 'LIST_FROM_MEMORY'
http://www.synactive.com/docu_e/specials/webreport.html
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3090http [original link is broken] [original link is broken] [original link is broken] [original link is broken]://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/submit.htm
thanks
mrutyun^
‎2006 Nov 21 3:18 PM
You aren't catching the error. Call the FM like this:
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = abaplist
<b>EXCEPTIONS
not_found = 1.</b>
IF sy-subrc <> 0.
*No list to process.
ENDIF.
Rob
‎2006 Nov 22 1:24 AM
Hi there!
I solved my problem! I am working on ZTEST program, and try to export list to memory using submit ZTEST. And finally I found that i get the NOT FOUND error if i am submitting the same program, if I separate it into 2 program, such as SUBMIT ZTEST_2 EXPORT...., it works well no matter in frontend or as background job.
Thanks a lot for your help.. You guys do let me learn a lot about ABAP!
Best Regards,
huai ying..