Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spool Extract/Reformat Program

Former Member
0 Likes
1,461

Does anyone know of a process/program that can reformat/download a spool file (non-ALV)? We’re 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

1 ACCEPTED SOLUTION
Read only

Former Member
1,033

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.

4 REPLIES 4
Read only

Former Member
0 Likes
1,033

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

Read only

Former Member
1,034

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.

Read only

Former Member
0 Likes
1,033

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

Read only

Former Member
0 Likes
1,033

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.