‎2007 Mar 20 1:18 AM
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
‎2007 Mar 20 1:47 AM
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.
‎2007 Mar 20 1:53 AM
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>
‎2007 Mar 20 2:01 AM
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