Application Development and Automation 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: 
Read only

Spool a Report

Former Member
0 Likes
666

Hi all,

Can anyone tell me how do I spool a report through a Program.

Thanks in advance.

Prince

5 REPLIES 5
Read only

athavanraja
Active Contributor
0 Likes
570
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_spool

with the above what ever is written in the form write_summary will be sent to spool

Regards

Raja

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
570

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.

Read only

Former Member
0 Likes
570

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

Read only

Former Member
0 Likes
570
Read only

Former Member
0 Likes
570

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