Skip to Content

Spool Need to Convert to Excel file and send via Email

Oct 26, 2016 at 06:01 AM


avatar image
Former Member

Hello All,

My Requirement is Spool need to convert in to excel file and send via email, like Z program or Define Job Wizard SM36 periodically.

1. When i am using z program for this , i am getting the out put of the spool in excel , those data are printing in the excel file in one cell, herewith i have attached the output.

But the requirement of the excel output is when we manually download the spool to excel one format will come. like that we required. is it possible to get the output like this ?

2. if i go for SM36, instead of Z program, can i get excel format like above ?

Could you please suggest ?


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Matthew Billingham
Oct 26, 2016 at 08:34 AM

Using abap2xlsx and the function module RSPO_RETURN_ABAP_SPOOLJOB to read the spool, I developed a program that does exactly this.

The starting point is the function module which returns an internal table (use a line type of TXMISPOROW). You can then parse this using simple ABAP. For example, if you put a blank line for all ---------------------- lines on the spool, and replace all | with ; (or ,) you'll be able to download as a CSV. To download as xlsx, use abap2xlsx, or one of the other solutions available (search).

10 |10000 characters needed characters left characters exceeded