09-03-2006 9:46 AM
I m able to generate spool by the below given code . My requirement is to create spool but it is printing also which i don't need.. "NEW-PAGE PRINT ON " needs to changed to NEW-PAGE PRINT off . if some thing else needs to changed then plz give me some suggestion.
Waiting for reply.
CONSTANTS:
WC_LAY TYPE PRI_PARAMS-PAART VALUE 'X_65_255' ,
WC_LINES TYPE PRI_PARAMS-LINCT VALUE '65' ,
WC_ROWS TYPE PRI_PARAMS-LINSZ VALUE '255' .
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
LAYOUT = WC_LAY
LINE_COUNT = WC_LINES
LINE_SIZE = WC_ROWS
NO_DIALOG = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = WS_ARCPAR
OUT_PARAMETERS = WS_PRIPAR
VALID = WS_VAL
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF WS_VAL <> SPACE AND SY-SUBRC = 0 .
NEW-PAGE PRINT ON PARAMETERS WS_PRIPAR NO DIALOG .
PERFORM DISPLAY_LIST " Write statements .
<b>NEW-PAGE PRINT OFF</b> .
F_MI_RQIDENT = SY-SPONO.
end if.
09-03-2006 10:26 AM
pass a blank to immediately parameter of get_print_parameters function.
<b>immediately = ' '</b>
here is the complete code.
data: loc_dest like pri_params-pdest .
clear : wf_listname , loc_dest , wf_listtext .
move: 'listname heading' to wf_listname .
move: 'list text' 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 .
Regards
Raja
Message was edited by: Durairaj Athavan Raja
09-03-2006 10:26 AM
pass a blank to immediately parameter of get_print_parameters function.
<b>immediately = ' '</b>
here is the complete code.
data: loc_dest like pri_params-pdest .
clear : wf_listname , loc_dest , wf_listtext .
move: 'listname heading' to wf_listname .
move: 'list text' 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 .
Regards
Raja
Message was edited by: Durairaj Athavan Raja
09-04-2006 8:19 AM
09-04-2006 1:56 AM
Hi,
CONSTANTS:
WC_LAY TYPE PRI_PARAMS-PAART VALUE 'X_65_255' ,
WC_LINES TYPE PRI_PARAMS-LINCT VALUE '65' ,
WC_ROWS TYPE PRI_PARAMS-LINSZ VALUE '255' .
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
LAYOUT = WC_LAY
LINE_COUNT = WC_LINES
LINE_SIZE = WC_ROWS
NO_DIALOG = 'X'
<b>IMMEDIATELY = ' '</b>
IMPORTING
OUT_ARCHIVE_PARAMETERS = WS_ARCPAR
OUT_PARAMETERS = WS_PRIPAR
VALID = WS_VAL
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF WS_VAL <> SPACE AND SY-SUBRC = 0 .
NEW-PAGE PRINT ON PARAMETERS WS_PRIPAR NO DIALOG .
PERFORM DISPLAY_LIST " Write statements .
NEW-PAGE PRINT OFF .
F_MI_RQIDENT = SY-SPONO.
end if.
The change which is marked in Bold is the only change which you have to do. If you pass IMMEDIATELY as `X`, then the spool output is printed immediately and if it is kept blank, then it is not printed.
Best regards,
Prashant