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

SapScript in text file

Former Member
0 Likes
691

How do I save a SapScript spool in text file?

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
478

In a text file? I think it would like garbage anyway, a PDF would definitly be better.

For this you will need to convert the OTF code to PDF using the function module CONVERT_OTF_TO_PDF(i think that is named like this).

REgards,

RIch Heilman

Read only

Former Member
0 Likes
478

Hi,

If the Spool output has a image or logo, then there is no point in downloading it to a text file. Otherwise, you can use the following FM`s :

RSPO_DOWNLOAD_SPOOLJOB - To download the spool. Provide the filename with .TXT extension.

For eg.

Call Function `RSPO_DOWNLOAD_SPOOLJOB`

Exporting

ID = l_spool_numbr

FNAME = `C:\spool.txt`

.

I tested it, and it is working fine as per your requirement.

Best regards,

Prashant

Read only

Former Member
0 Likes
478

Hi Claudeni,

How to Convert SAP Script to Text (OTF)? 
Manual conversion to OTF format 

If there are more than 10 pages, 
Tick the spool request 
then click Edit -> OTF display -> No. of OTF pages 
Convert SAP Script to text 
Display the spool request 
then click Goto -> List display 
Automatic conversion to OTF format 
tables: tline. 
data:   begin of int_tline1 occurs 100. 
             include structure tline. 
data:   end of int_tline1. 

call function 'OPEN_FORM' 
                 device         = 'OTF_MEM' 
          ......................................... 




* after CLOSE_FORM 
call function 'CONVERT_OTF_MEMORY' 
     exporting 
          format                = 'ASCII' 
          max_linewidth         = 132 
     tables 
           lines                 = int_tline1 
     exceptions 
          err_max_linewidth        = 1 
          err_format                    = 2 
          err_conv_not_possible = 3 
          others                          = 4. 







* write the text file to spool 
loop at int_tline1. 
   if int_tline1-tdline = space. 
      skip. 
   else. 
      write:/ int_tline1-tdline. 
   endif. 
endloop. 

Cheers

VJ