Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Want to create a Spool but do not want to print

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

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

3 REPLIES 3

athavanraja
Active Contributor
0 Kudos

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

0 Kudos

Thanks Raja

Problem resolved

former_member223537
Active Contributor
0 Kudos

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