2008 May 02 12:56 PM
Does anyone know of a process/program that can reformat/download a spool file (non-ALV)? Were trying to automate a download of various reports one of which is from t-code co28. When we run the program in the background we want to auto download and reformat the spool files that get generated (Removing header rows, blank rows, and page number rows, etc). The intent of the files is to be loaded into an external database like access or even pulled up in Excel without having to manually remove any of the extra header row info. Any insight is greatly appreciated.
Thanks, David
2008 May 02 1:41 PM
Hi David,
you can get the spool file data with FM RSPO_RETURN_ABAP_SPOOLJOB. This will just return a flat internal table with the text of the spool. With this you can do whatever you need. You can probably also do some smart things with other function modules in package SPOO, like determining the page length etc.
Good luck,
Gert.
2008 May 02 1:34 PM
Hi David,
There is a function module to download the spool data. Later we need to reprocess that data, and then prepare it in a way suitable to usby downloading the whole spool data into an internal table and format it according to our interest.
While executing your background job, try and hold the spool id in a variable and then use this FM,
'RSPO_RETURN_SPOOLJOB'.*
Example of using this FM:
*********************************************************************
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = wa_it_spool_attr-spoolid
first_line = startline
last_line = endline
desired_type = 'RAW'
TABLES
buffer = it_buffer
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
*********************************************************************
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T
2008 May 02 1:41 PM
Hi David,
you can get the spool file data with FM RSPO_RETURN_ABAP_SPOOLJOB. This will just return a flat internal table with the text of the spool. With this you can do whatever you need. You can probably also do some smart things with other function modules in package SPOO, like determining the page length etc.
Good luck,
Gert.
2008 May 02 1:52 PM
Thanks those will be helpful hints but I was hoping there would be something standard in the SAP ABAP programs to reformat spool files. Do you know if there is anything?
David
2008 May 20 7:04 PM
These will help us to develop something in-house as I was hoping there was something standard that SAP provided but there isn't. I also find Compelo software thru symtrax which will accomodate this but you have to purchase and manage the software. The site is http://www.symtrax.com/
Not sure if we will use Symtrax yet or not.