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

SUBMIT program and spool number

Former Member
0 Likes
1,033

How to get a spool number (SY-SPONO or any other number) of the list created by a SUBMIT command, when using

SUBMIT.. TO SAP-SPOOL

Also note that the SUBMIT is executed with in a batch / background job

Helpful answers will be definitely rewarded

3 REPLIES 3
Read only

Former Member
0 Likes
819

Vishnu,

Just use <b>sy-spono</b> anywhr after your first Write statement.It will give you the spool number generated by the system.

You can get the spool number from the table <b>TSP01</b> also.

Rgds,

Jothi.

*let me know the outcome.

Read only

0 Likes
819

I tried using SY-SPONO, the problem is SY-SPONO is not set after the SUBMIT command both in foreground and background modes.

I want to access the spool created by a SUBMIT command in the calling program.

I think, I have found out a way to do this, will have to test.. but if there is any better way...

  submit (p_repid) to sap-spool without spool dynpro
                   spool parameters mstr_print_parms
                   via selection-screen
                   and return.
*-- Find out what the spool number is that was just created
  perform get_spool_number using sy-repid
             sy-uname
    changing mi_rqident.



  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

<a href="http://abap4.tripod.com/Save_Report_Output_to_a_PDF_File.html">Credits</a>

Read only

0 Likes
819

Hope u r on right track and it will work.

We have either to use sy-spono or tsp01 table.

Im also using the same logic and it works fine.

Rgds,

Jothi.P