cancel
Showing results for 
Search instead for 
Did you mean: 

output of a report to spool

Former Member
0 Kudos

Hi All,

how to send output of a report to spool and output of of report should not be display and i need spool number in status bar of the selection screen.all this function should happen when i exectute selcetion after providing varient in selection and selection secreen should not change and in staus bar i need spool number.

thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

i my self has slove my problem

Former Member
0 Kudos

Hi All,

how to send output of a report to spool and output of of report should not be display and i need spool number in status bar of the selection screen.all this function should happen when i exectute selcetion after providing varient in selection and selection secreen should not change and in staus bar i need spool number.

thanks in advance

venkat_o
Active Contributor
0 Kudos

Hi, Try this way. It works.


 REPORT ztest_notepad.
 "Variables
 DATA:
    l_lay    TYPE pri_params-paart,
    l_lines  TYPE pri_params-linct,
    l_cols   TYPE pri_params-linsz,
    l_val    TYPE c.
*Types
 TYPES:
    t_pripar TYPE pri_params,
    t_arcpar TYPE arc_params.
 "Work areas
 DATA:
    lw_pripar TYPE t_pripar,
    lw_arcpar TYPE t_arcpar.

 PARAMETERS : p_data(10).

 START-OF-SELECTION.

   l_lay   = 'X_65_132'.
   l_lines = 65.
   l_cols  = 132.
   "Read, determine, change spool print parameters and archive parameters
   CALL FUNCTION 'GET_PRINT_PARAMETERS'
     EXPORTING
       in_archive_parameters  = lw_arcpar
       in_parameters          = lw_pripar
       layout                 = l_lay
       line_count             = l_lines
       line_size              = l_cols
       no_dialog              = 'X'
     IMPORTING
       out_archive_parameters = lw_arcpar
       out_parameters         = lw_pripar
       valid                  = l_val
     EXCEPTIONS
       archive_info_not_found = 1
       invalid_print_params   = 2
       invalid_archive_params = 3
       OTHERS                 = 4.
   IF l_val  NE space AND sy-subrc = 0.
     lw_pripar-prrel = space.
     lw_pripar-primm = space.
     NEW-PAGE PRINT ON
       NEW-SECTION
       PARAMETERS lw_pripar
       ARCHIVE PARAMETERS lw_arcpar
       NO DIALOG.
   ENDIF.
   WRITE 'Output in spool'.
   NEW-PAGE PRINT OFF.
   CALL FUNCTION 'ABAP4_COMMIT_WORK'.
   DATA:text TYPE string.
   CONCATENATE 'Spool' sy-spono 'is generated' INTO text SEPARATED BY space.
   MESSAGE text  TYPE 'S'.
Thanks Venkat.O

kesavadas_thekkillath
Active Contributor
0 Kudos

Dont ask the same Question Did you check with the replies ?

Former Member
0 Kudos

thanks for your quick reply but in spool my output of report is not coming ouytput is empty and in my program i am seeing my output i dont nrrd my output to be seen there and i did under stand what input i have give in p_data..

thanks

kesavadas_thekkillath
Active Contributor
0 Kudos

NEW-PAGE PRINT ON

COPIES 1

LIST NAME 'Test list'

COVER TEXT 'Output of test report'

SAP COVER PAGE ' '

DESTINATION 'LP01'

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

DATASET EXPIRATION 3

NO DIALOG.

write pa_1. "<----This where you have to write your complete write statements

NEW-PAGE PRINT OFF.

kesavadas_thekkillath
Active Contributor
0 Kudos

Try this too

Consider ZSPOOLTEST holds all your write statements.

call ZSPOOLTEST from a program in this manner




data: mstr_print_parms like pri_params.
data: mi_rqident       like tsp01-rqident.

call function 'GET_PRINT_PARAMETERS' 
    exporting 
      authority = space 
      copies   = '1' 
      cover_page                   = space 
      data_set = space 
      department                   = space 
      destination                  = space 
      expiration                   = '1' 
      immediately                  = space 
      in_archive_parameters        = space 
      in_parameters                = space 
      layout   = space 
      mode     = space 
      new_list_id                  = 'X' 
      no_dialog = 'X' 
      user     = sy-uname 
    importing 
      out_parameters               = mstr_print_parms 
      valid    = mc_valid 
    exceptions 
      archive_info_not_found       = 1 
      invalid_print_params         = 2 
      invalid_archive_params       = 3 
      others   = 4. 




   if mstr_print_parms-pdest = space. 
     mstr_print_parms-pdest = 'LOCL'. 
   endif. 
 



 submit (ZSPOOLTEST) to sap-spool without spool dynpro  "Include any selection screen entries if any
                    spool parameters mstr_print_parms 
                    and return. 

 perform get_spool_number using sy-repid 
                                  sy-uname
			  changing mi_rqident.

 if mi_rqident is not initial.
 message s000(ZSD) with mi_rqident.     "Your message triggers here
 endif.

form get_spool_number using f_repid 
      			    f_uname 
                 changing f_rqident. 

   data: lc_rq2name like tsp01-rq2name. 

   concatenate f_repid+0(8) 
               f_uname+0(3) 
     into lc_rq2name separated by '__'. 

   select * from tsp01 where  rq2name = lc_rq2name 
   order by rqcretime descending. 
     f_rqident = tsp01-rqident. 
     exit. 
   endselect. 

   if sy-subrc ne 0. 
     clear f_rqident. 
   endif. 

endform." get_spool_number 

Former Member
0 Kudos

hi

thaks for your reply i am getting this error in you code plz help

Field "MC_VALID" is unknown. It is neither in one of the specified

A target area must be declared either explicitly with an INTO clause or implicitly with a TABLES statement.

Field "TSP01-RQIDENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .

kesavadas_thekkillath
Active Contributor
0 Kudos

It was just an example

cant you declare those fields ??

tables:tsp01.

data:mc_valid TYPE bool.

Edited by: Keshu Thekkillam on Sep 1, 2009 5:22 PM

Former Member
0 Kudos

thank for your quick reply but my program is going to dump plz check and help me

kesavadas_thekkillath
Active Contributor
0 Kudos

What is the dump analysis report

Former Member
0 Kudos

runtimr errors: call_function_uc_struct

and dump is pointing at fm GET_PRINT_PARAMETERS

kesavadas_thekkillath
Active Contributor
0 Kudos

paste the complete Dump analysis !!

kesavadas_thekkillath
Active Contributor
0 Kudos

Search for more results on this

This is just a code piece


parameters: pa_1 type char255.
data:spool_no type RSPOID.

start-of-selection.

NEW-PAGE PRINT ON
         COPIES 1
         LIST NAME 'Test list'
         COVER TEXT  'Output of test report'
         SAP COVER PAGE ' '
         DESTINATION 'LP01'
         IMMEDIATELY  'X'
         KEEP IN SPOOL 'X'
         DATASET EXPIRATION 3
         NO DIALOG.
write pa_1.
NEW-PAGE PRINT OFF.
spool_no = sy-spono.
message s001(Z_ART_001) with spool_no.