‎2009 Aug 31 8:12 AM
Hi everybody,
I just asking to find a solution for my project.
I want to use some data in R/3 report, which is running in background.
Is it possible we get data directly from spool (TX: SP01) and use it program?
Regards,
Steph
‎2009 Aug 31 9:26 AM
yes this is possible, you can take spool number from table TSP01 and read the spool data as follows:
SUBMIT rspolst2 EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = Spool Number
WITH first = '1'
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = mem_tab (LIKE TABLE OF abaplist)
IF NOT mem_tab[] IS INITIAL.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
List_index = -1
TABLES
listasci = g_t_text (table type c length 5000)
listobject = mem_tab
ENDIF.
by this way your spool data will come into table g_t_text .
‎2009 Aug 31 8:15 AM
Hi Steph,
<li>Yes It is possible to use in your program. Use below function module to read spool
Thanks
Venkat.O
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = g_spool_no
no_dialog = ' '
IMPORTING
pdf_bytecount = l_no_of_bytes
pdf_spoolid = l_pdf_spoolid
btc_jobname = l_jobname
btc_jobcount = l_jobcount
TABLES
pdf = i_pdf
‎2009 Aug 31 8:21 AM
Hi,
First get the spool number from TSP01 table and then use the FM 'CONVERT_ABAPSPOOLJOB_2_PDF'.
Regards,
Nagaraj
‎2009 Sep 01 3:31 AM
Sorry Nagaraj and Venkat,
Is this FM use to convert spool result into PDF file?
Regards,
Steph
‎2009 Aug 31 9:26 AM
yes this is possible, you can take spool number from table TSP01 and read the spool data as follows:
SUBMIT rspolst2 EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = Spool Number
WITH first = '1'
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = mem_tab (LIKE TABLE OF abaplist)
IF NOT mem_tab[] IS INITIAL.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
List_index = -1
TABLES
listasci = g_t_text (table type c length 5000)
listobject = mem_tab
ENDIF.
by this way your spool data will come into table g_t_text .
‎2009 Sep 01 3:36 AM
Thanks Sheelesh, it's work, eventhough I must separated the data one by one
it very plain text, but still separated by delimiter so that's ok...
Regards,
Steph