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: 

Keep the SPOOL file on the system for 8 days, How?

Former Member
0 Kudos

Hi Experts,

I am writing a SPOOL file into the system, by using the following code.

Actualy, I did not assigned any value to the either PARAM or pri_params.

So, it just creating the SPPOL file on the system, fine.

FORM write_to_spool .

DATA param TYPE pri_params.

IF sy-batch IS INITIAL.

CHECK NOT t_err_out[] IS INITIAL.

NEW-PAGE PRINT ON

PARAMETERS param

NO DIALOG.

    • download error file to spool*

LOOP AT t_err_out.

WRITE: /(10) t_err_out-banfn,

25(18) t_err_out-matnr,

50(100) t_err_out-exception.

ENDLOOP.

NEW-PAGE PRINT OFF.

ENDIF.

ENDFORM. " write_to_spool

So, my requirement is to KEEP THE SPOOL FILE ON THE SYSTEM FOR 8 DAYS.

So, I found some hting, pri_params-pexpi:

So, pls. EDIT my code, in such away to meet my requirement of keeping the spool file on the system for 8 days.

thanq

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try this:

REPORT zdemo_list_new_page_print_on NO STANDARD PAGE HEADING.

DATA: val(1) TYPE c,

pripar TYPE pri_params,

arcpar TYPE arc_params,

lay TYPE pri_params-paart,

lines TYPE pri_params-linct,

rows TYPE pri_params-linsz.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

exporting

authority = space

copies = '1'

cover_page = space

data_set = space

department = space

destination = space

expiration = '8' " <=================

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 = pripar

out_archive_parameters = arcpar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

SET PF-STATUS 'PRINT'.

WRITE ' Select a format!'.

ENDIF.

TOP-OF-PAGE DURING LINE-SELECTION.

WRITE: 'Page', sy-pagno.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'PORT'.

lay = 'X_65_80'.

lines = 60.

rows = 55.

PERFORM format.

WHEN 'LAND'.

lay = 'X_65_132'.

lines = 60.

rows = 110.

PERFORM format.

ENDCASE.

FORM format.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

in_archive_parameters = arcpar

in_parameters = pripar

layout = lay

line_count = lines

line_size = rows

no_dialog = 'X'

IMPORTING

out_archive_parameters = arcpar

out_parameters = pripar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

PERFORM list.

ENDIF.

ENDFORM.

FORM list.

NEW-PAGE PRINT ON

NEW-SECTION

PARAMETERS pripar

ARCHIVE PARAMETERS arcpar

NO DIALOG.

DO 440 TIMES.

WRITE (3) sy-index.

ENDDO.

NEW-PAGE PRINT OFF.

ENDFORM.

5 REPLIES 5

Former Member
0 Kudos

Srinivas,

Define a structure of type PRI_PARAMS and set the value 8 to field PEXPI.

Use GET_PRITNT_PARAMETERS function module (IN_PARAMETERS parameter) to get the PRI_PARAMS structure. Change whatever parameters (say page length) and call SET_PRINT_PARAMETERS function module to set the spool parameters.

After the above, write your spool and it should be fine.

Thanks,

Naren

Edited by: Naren K Someneni on Jun 18, 2008 9:15 AM

0 Kudos

thanq

I got the FM by using PATTERN. but, pls. let me know, Wht r I hv to pass to these both FMs?

CALL FUNCTION 'GET_PRINT_PARAMETERS'

  • EXPORTING

  • ARCHIVE_ID = C_CHAR_UNKNOWN

  • ARCHIVE_INFO = C_CHAR_UNKNOWN

  • ARCHIVE_MODE = C_CHAR_UNKNOWN

  • ARCHIVE_TEXT = C_CHAR_UNKNOWN

  • AR_OBJECT = C_CHAR_UNKNOWN

  • ARCHIVE_REPORT = C_CHAR_UNKNOWN

  • AUTHORITY = C_CHAR_UNKNOWN

  • COPIES = C_NUM3_UNKNOWN

  • COVER_PAGE = C_CHAR_UNKNOWN

  • DATA_SET = C_CHAR_UNKNOWN

  • DEPARTMENT = C_CHAR_UNKNOWN

  • DESTINATION = C_CHAR_UNKNOWN

  • EXPIRATION = C_NUM1_UNKNOWN

  • IMMEDIATELY = C_CHAR_UNKNOWN

  • IN_ARCHIVE_PARAMETERS = ' '

  • IN_PARAMETERS = ' '

  • LAYOUT = C_CHAR_UNKNOWN

  • LINE_COUNT = C_INT_UNKNOWN

  • LINE_SIZE = C_INT_UNKNOWN

  • LIST_NAME = C_CHAR_UNKNOWN

  • LIST_TEXT = C_CHAR_UNKNOWN

  • MODE = ' '

  • NEW_LIST_ID = C_CHAR_UNKNOWN

  • PROTECT_LIST = C_CHAR_UNKNOWN

  • NO_DIALOG = C_FALSE

  • RECEIVER = C_CHAR_UNKNOWN

  • RELEASE = C_CHAR_UNKNOWN

  • REPORT = C_CHAR_UNKNOWN

  • SAP_COVER_PAGE = C_CHAR_UNKNOWN

  • HOST_COVER_PAGE = C_CHAR_UNKNOWN

  • PRIORITY = C_NUM1_UNKNOWN

  • SAP_OBJECT = C_CHAR_UNKNOWN

  • TYPE = C_CHAR_UNKNOWN

  • USER = SY-UNAME

  • USE_OLD_LAYOUT = ' '

  • UC_DISPLAY_MODE = C_CHAR_UNKNOWN

  • DRAFT = C_CHAR_UNKNOWN

  • ABAP_LIST = ' '

  • USE_ARCHIVENAME_DEF = ' '

  • DEFAULT_SPOOL_SIZE = C_CHAR_UNKNOWN

  • PO_FAX_STORE = ' '

  • NO_FRAMES = C_CHAR_UNKNOWN

  • IMPORTING

  • OUT_ARCHIVE_PARAMETERS =

  • OUT_PARAMETERS =

  • VALID =

  • VALID_FOR_SPOOL_CREATION =

  • EXCEPTIONS

  • ARCHIVE_INFO_NOT_FOUND = 1

  • INVALID_PRINT_PARAMS = 2

  • INVALID_ARCHIVE_PARAMS = 3

  • OTHERS = 4

-


CALL FUNCTION 'SET_PRINT_PARAMETERS'

  • EXPORTING

  • ARCHIVE_ID = C_CHAR_UNKNOWN

  • ARCHIVE_INFO = C_CHAR_UNKNOWN

  • ARCHIVE_MODE = C_CHAR_UNKNOWN

  • ARCHIVE_TEXT = C_CHAR_UNKNOWN

  • AR_OBJECT = C_CHAR_UNKNOWN

  • AUTHORITY = C_CHAR_UNKNOWN

  • COPIES = C_NUM3_UNKNOWN

  • COVER_PAGE = C_CHAR_UNKNOWN

  • DATA_SET = C_CHAR_UNKNOWN

  • DEPARTMENT = C_CHAR_UNKNOWN

  • DESTINATION = C_CHAR_UNKNOWN

  • EXPIRATION = C_NUM1_UNKNOWN

  • IMMEDIATELY = C_CHAR_UNKNOWN

  • IN_ARCHIVE_PARAMETERS = ' '

  • IN_PARAMETERS = ' '

  • LAYOUT = C_CHAR_UNKNOWN

  • LINE_COUNT = C_INT_UNKNOWN

  • LINE_SIZE = C_INT_UNKNOWN

  • LIST_NAME = C_CHAR_UNKNOWN

  • LIST_TEXT = C_CHAR_UNKNOWN

  • NEW_LIST_ID = C_CHAR_UNKNOWN

  • RECEIVER = C_CHAR_UNKNOWN

  • RELEASE = C_CHAR_UNKNOWN

  • SAP_COVER_PAGE = C_CHAR_UNKNOWN

  • HOST_COVER_PAGE = C_CHAR_UNKNOWN

  • PRIORITY = C_NUM1_UNKNOWN

  • SAP_OBJECT = C_CHAR_UNKNOWN

  • TYPE = C_CHAR_UNKNOWN

  • FOOT_LINE = C_CHAR_UNKNOWN

thanq

Pawan_Kesari
Active Contributor
0 Kudos

FORM write_to_spool .

  DATA param TYPE pri_params.


  IF sy-batch IS INITIAL.

     CHECK NOT t_err_out[] IS INITIAL.

     param-PEXPI = 8 . "******************     

     NEW-PAGE PRINT ON
     PARAMETERS param
     NO DIALOG.

*    download error file to spool
     LOOP AT t_err_out.
           WRITE: /(10) t_err_out-banfn,
                        25(18) t_err_out-matnr,
                        50(100) t_err_out-exception.
      ENDLOOP.

      NEW-PAGE PRINT OFF.

   ENDIF.
ENDFORM. " write_to_spool

and to follow the forum rules here is link from where i got this information

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba56d35c111d1829f0000e829fbfe/content.htm

Edited by: Pawan Kesari on Jun 18, 2008 7:44 PM

Edited by: Pawan Kesari on Jun 18, 2008 7:45 PM

0 Kudos

causing dump.

Former Member
0 Kudos

Try this:

REPORT zdemo_list_new_page_print_on NO STANDARD PAGE HEADING.

DATA: val(1) TYPE c,

pripar TYPE pri_params,

arcpar TYPE arc_params,

lay TYPE pri_params-paart,

lines TYPE pri_params-linct,

rows TYPE pri_params-linsz.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

exporting

authority = space

copies = '1'

cover_page = space

data_set = space

department = space

destination = space

expiration = '8' " <=================

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 = pripar

out_archive_parameters = arcpar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

SET PF-STATUS 'PRINT'.

WRITE ' Select a format!'.

ENDIF.

TOP-OF-PAGE DURING LINE-SELECTION.

WRITE: 'Page', sy-pagno.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'PORT'.

lay = 'X_65_80'.

lines = 60.

rows = 55.

PERFORM format.

WHEN 'LAND'.

lay = 'X_65_132'.

lines = 60.

rows = 110.

PERFORM format.

ENDCASE.

FORM format.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

in_archive_parameters = arcpar

in_parameters = pripar

layout = lay

line_count = lines

line_size = rows

no_dialog = 'X'

IMPORTING

out_archive_parameters = arcpar

out_parameters = pripar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

PERFORM list.

ENDIF.

ENDFORM.

FORM list.

NEW-PAGE PRINT ON

NEW-SECTION

PARAMETERS pripar

ARCHIVE PARAMETERS arcpar

NO DIALOG.

DO 440 TIMES.

WRITE (3) sy-index.

ENDDO.

NEW-PAGE PRINT OFF.

ENDFORM.