‎2009 Jan 13 10:18 AM
hi all,
i have a requirement like i have to create a spool in a program and should read that spool and send a email in same program.
i m done with creating spool and sending email but the problem is when i execute a program the spool is created only after total program execution, is there a way to create a compleate spool before finishing the report execution.
thanks,
‎2009 Jan 13 10:34 AM
Hello Deep,
I will like to carry forward from where Nagaraj left.
IF gd_jobname IS NOT INITIAL AND gd_jobcount IS NOT INITIAL.
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident '0000000000'.
IF sy-subrc = 0.
SORT it_tbtcp BY jobnm jobcnt stepcnt.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDIF.
ENDIF.
You will have the spool no. in gd_spool_nr.
BR,
Suhas
Edited by: Suhas Saha on Jan 13, 2009 11:39 AM
‎2009 Jan 13 10:28 AM
Hi,
try like this
First call the FM 'SET_PRINT_PARAMETERS'.
then SUBMIT <program name>
TO SAP-SPOOL SPOOL PARAMETERS <paramters u get from the above FM>
USER sy-uname VIA JOB g_name NUMBER g_number
WITHOUT SPOOL DYNPRO..
Regards,
Nagaraj
‎2009 Jan 13 10:33 AM
hi,
my requirement is
im executing a zprogram and wirtten the output after this im creating spool in same program and now i have to read this created spool and send as mail. sending mail part creation of spool part is ok but the spool is created but only after the report totally finished.
thanks,
anupama.
‎2009 Jan 13 10:34 AM
Hello Deep,
I will like to carry forward from where Nagaraj left.
IF gd_jobname IS NOT INITIAL AND gd_jobcount IS NOT INITIAL.
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident '0000000000'.
IF sy-subrc = 0.
SORT it_tbtcp BY jobnm jobcnt stepcnt.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDIF.
ENDIF.
You will have the spool no. in gd_spool_nr.
BR,
Suhas
Edited by: Suhas Saha on Jan 13, 2009 11:39 AM
‎2009 Jan 13 10:41 AM
Solution:
call function 'GET_PRINT_PARAMETERS'
exporting
destination = 'LP01'
copies = count
list_name = 'ZTEST'
list_text = 'ZTESTSPOOL'
immediately = ' '
release = 'X'
new_list_id = 'X'
expiration = days
line_size = 90
line_count = 65
layout = 'X_PAPER'
sap_cover_page = 'X'
receiver = 'SAP*'
department = 'System'
no_dialog = 'X'
importing
out_parameters = params
valid = valid.
new-page print on parameters params no dialog.
write : hi this is the test for spool.
new-page print off.
commit work.
write : / sy-spono. "system variable for spool no
solved thanks
anupama.