‎2008 Jul 24 1:37 PM
Hi friends!
I am storing data into memory and then displaying via WRITE_LIST FM, can i store this to spool at background mode.
Any ideas?
Please assist.
Thank you.
‎2008 Jul 24 1:44 PM
Instead of Exporting list to memory , You could use JOB
I hope you got the list object from SUBMIT option export list to memory.
But In your case you have to use SUBMIT using Job options.
You need call the submit , inbetween open_job and close_job functions. and you need to pass spool params etc.
Check the SUBMIT using Job options.
‎2008 Jul 24 1:46 PM
Thanks.
But SUBMIT/JOBS doesnt suit my requirement.
I have tried that too, therefore now looking to send data to spool.
‎2008 Jul 24 2:01 PM
‎2008 Jul 24 2:18 PM
Could you please tell more about the FM or how do i use that?
‎2008 Jul 24 3:49 PM
using this function module u can submit your report in background.....
Amitava
‎2009 Dec 30 8:11 AM
Hi
I am facing the same problem, after using write_list
it is being diaplyed in foreground, but in background, the o/p is not exactly the same
please help
Thanks and Regards
Manu
‎2009 Dec 30 8:34 AM
Hi
I am facing the same problem, after using FM 'LIST_FROM_MEMORY'
i am using 'list_to_ascii', and doing loop on the internal table returned, it is being displayed correctly in foreground
but not in background. Please suggest.
Thanks and Regards
Manu
‎2009 Dec 30 8:51 AM
Hi Manu,
What I understand is:
1. You have created a Z program.
2. In that Z program, you are using SUBMIT for a standard program and collecting LIST_FROM_MEMORY.
and using other FM's.
You requirement is
a) To schedule the Z program in background
b) The spool of this Z Program should contain SAME output AS THAT OF of the SUBMIT ed program.
3. In that case,
a) After you use LIST_FROM_MEMORY (in Z Program)
b) use WRITE_LIST directly
(No need to use LIST_TO_ASCI or Write statements for sy-batch).
4. I just tried and it works fine - Both in foreground and background.
5. Just copy paste this program and run in FOREGROUND and BACKGROUND
In SM37 (for background), the spool will be SAME as FOREGROUND.
report abc.
*-----------------------------------------------------------
data:lt_listobject type table of abaplist.
*-----------------------------------------------------------
submit RM07MLBS
with matnr = '3' "<----- Change
with werks = '1000' "<------ Change
exporting list to memory and return.
*-----------------------------------------------------------
call function 'LIST_FROM_MEMORY'
tables
listobject = lt_listobject
exceptions
not_found = 1
others = 2.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = lt_listobject
EXCEPTIONS
empty_list = 1
OTHERS = 2.
call function 'LIST_FREE_MEMORY'
tables
listobject = lt_listobject.
Regards,
Amit Mittal.
‎2009 Dec 30 9:46 AM
Hi Amit
Thanks for the reply. i am using the following code
submit RPUAUD00 with lo_blg eq lo_blg
with sh_blg eq sh_blg
WITH arc_db eq arc_db
with user_sel eq user_sel
with r_tclasa eq r_tclasa
with r_tclasb eq r_tclasb
with r_tclas eq r_tclas
WITH persnr IN range_tab
with infty in infty
with datum in datum
with uname in uname
with def_curr eq def_curr
with expand eq expand
with exp_page eq exp_page
with prnt_sel eq prnt_sel
with out_alv eq out_alv
with ra_time eq ra_time
with ra_pernr eq ra_pernr
with ra_infty eq ra_infty
with ra_uname eq ra_uname
with sy-UCOMM eq ''
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
The o/p which is in alv list format is correctly displayed in foreground, but not in background
please help
Thanks and Regards
Manu
‎2009 Dec 30 10:30 AM
Hi Manu,
That is because the program RPUAUD00 behaves different in foreground and in background.
In foreground:
It shows header records in alv. Then when we double-click,
It shows detail records, in slightly different format as compared to header.
In background.
It Directly shows all detail records.
If in foreground, on selection screen, if you choose the checkbox "Direct output of Docs", then foreground and background will automatically match.
Hence, the problem is not with abap program - WRITE_LIST.
This works fine with other programs submitted.
Regards,
Amit Mittal.