Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 09:03 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 02:14 PM
    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 02:09 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.