on 2009 Aug 31 1:34 PM
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
i my self has slove my problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this way. It works.
Thanks
Venkat.O
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'.
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
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 . . . . . . . . . .
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.