‎2006 Oct 11 11:35 AM
Hi all,
Can anyone tell me how do I spool a report through a Program.
Thanks in advance.
Prince
‎2006 Oct 11 11:44 AM
form send_report_to_spool.
data: loc_dest like pri_params-pdest .
clear : wf_listname , loc_dest , wf_listtext .
move: 'AP interface' to wf_listname .
move: 'AP interface' to wf_listtext .
select single spld into usr01-spld from usr01 where bname eq sy-uname .
if sy-subrc eq 0 .
move: usr01-spld to loc_dest .
endif .
call function 'GET_PRINT_PARAMETERS'
exporting
destination = loc_dest
copies = wf_copies
list_name = wf_listname
list_text = wf_listtext
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = wf_days
line_size = 200
line_count = 65
layout = 'X_65_200'
sap_cover_page = 'X'
receiver = 'SAP*'
department = ''
no_dialog = 'X'
importing
out_parameters = wf_params
valid = wf_valid.
if wf_valid <> space.
new-page print on parameters wf_params no dialog.
perform write_summary .
new-page print off.
endif .
endform. " send_report_to_spoolwith the above what ever is written in the form write_summary will be sent to spool
Regards
Raja
‎2006 Oct 11 11:46 AM
Hi,
Use the F.M <b>RSPO_DISPLAY_SPOOLJOB</b> to display spool job and then u can download it or read it for further processing.
Or u can use function module <b>RSPO_DOWNLOAD_SPOOLJOB</b> to download spool job..
Hope this is helpful..
Reward if helpful..
Cheers,
Simha.
‎2006 Oct 11 11:55 AM
Hi,
use FM get_print_parameters
new-page print on
new-page print off
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_INFO = 'AUT'
ARCHIVE_MODE = P_ARCHMODE
ARCHIVE_TEXT = DETAIL_TEXT(40)
AR_OBJECT = P_DOC
COPIES = 1
DESTINATION = WSPLD
IMMEDIATELY = WPIMM
RELEASE = ' '
SAP_COVER_PAGE = 'D'
LIST_TEXT = PTEXT
LIST_NAME = 'ZGJEAPP6'
MODE = 'batch '
NEW_LIST_ID = 'X'
NO_DIALOG = '1'
RECEIVER = SRTTAB1-SUPRV
COVER_PAGE = ' '
DEPARTMENT = ' '
EXPIRATION = 8
delete = ' '
SAP_OBJECT = P_OBJ
*?? authority = spool_auth
IMPORTING
OUT_ARCHIVE_PARAMETERS = ARPARAMS
OUT_PARAMETERS = PARAMS
VALID = VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF VALID <> ' '.
NEW-PAGE PRINT ON PARAMETERS PARAMS
ARCHIVE PARAMETERS ARPARAMS
NEW-SECTION NO DIALOG.
ENDIF.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_INFO = 'AUT'
ARCHIVE_MODE = P_ARCHMODE
ARCHIVE_TEXT = DETAIL_TEXT(40)
AR_OBJECT = P_DOC
COPIES = 1
DESTINATION = WSPLD
IMMEDIATELY = WPIMM
RELEASE = ' '
SAP_COVER_PAGE = 'D'
LIST_TEXT = PTEXT
LIST_NAME = 'ZGJEAPP6'
MODE = 'batch '
NEW_LIST_ID = 'X'
NO_DIALOG = '1'
RECEIVER = SRTTAB1-SUPRV
COVER_PAGE = ' '
DEPARTMENT = ' '
EXPIRATION = 8
delete = ' '
SAP_OBJECT = P_OBJ
*?? authority = spool_auth
IMPORTING
OUT_ARCHIVE_PARAMETERS = ARPARAMS
OUT_PARAMETERS = PARAMS
VALID = VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF VALID <> ' '.
NEW-PAGE PRINT ON PARAMETERS PARAMS
ARCHIVE PARAMETERS ARPARAMS
NEW-SECTION NO DIALOG.
ENDIF.
new-page print off.
use sy-PLIST to get spool name
Regards
amole
‎2006 Oct 11 12:10 PM
hi
good
go through this links, i hope this ll help you to solve your problem.
http://documentation.softwareag.com/natural/ngc311/ngc/ch_report_add.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/30/cc154219fce12ce10000000a1550b0/content.htm
thanks
mrutyun^
‎2007 Jun 22 8:36 AM
Hi frns,
Use New-page statement in report it will create spool number , capture that spool number by using system field SY-SPONO , now you will get spool number use that spool no. according to your requirement
Thanks
Ravi Kumar Yasoda