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: 

Change Title or name of spool request

Former Member
0 Kudos

Hi All,

I'd like to print a document and create a spool with a customized title or name of spool request. Have you got any idea on what is the module function that enables a Form to change the spool name ?

Thanks in advance.

Mohaned

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can use the FM RSPO_RW_SPOOLJOB_PARAMS

5 REPLIES 5

Former Member
0 Kudos

You can use the FM RSPO_RW_SPOOLJOB_PARAMS

Former Member
0 Kudos

Thanks for your reply.

Can it be called from a Form ? I tried to use this MF, but it doesn't work in the case of modifying a spool's text already edited in sp01.

Former Member
0 Kudos

What do you mean by form. Is it a smartform?

If so while generating the spool by calling the Smartform function module follow this. Assign these fields in output_options. Same can be followed in SAP scripts.

Key Note: How to give Spool names

These texts are all used to do the further processing of the spools. Where it is not always possible to recognize the spool by its spool number. Then this text comes in handy to recognize the correct spool. This is also useful when the form is processed inside a loop then the individual spool can be given a logical name where in after the spool processing these spools can be processed further.

TDDATASET: Spool request name. Three-part name of a spool request. The name is determined automatically by the spool system, but can be entered by the user or the program generating the request. There is no specified naming convention. Applications may apply their own naming conventions. For information on this, refer to the documentation of the respective application. Some common naming conventions:

a. Report lists: LIST1S <PRINTER NAME> <REPORT>_<USER NAME>

b. Printout from the ABAP editor: EDITOR PG <REPORTNAME> <TIME> <RELATIVE NUMBER OF THE OUTPUT REQUEST>

Note: A spool request can have both a spool request name and a title. The former is generated automatically by the spool system; the latter must be entered explicitly by the user or program generating the request. When the user enters a title for a request, this title is displayed in the spool output controller in place of the request name. However you can still search for the request name from the spool output controller's request screen.

TDSUFFIX1 and TDSUFFIX2 are the suffixes to the spool request name

TDCOVTITLE: This field contains the description of the spool request. It may consist of letters, digits, special characters, or blanks.

Former Member
0 Kudos

A similar case was handled,check the function module it may help u.

FORM write_to_spool.

DATA : l_f_list_name LIKE pri_params-plist,

l_f_destination LIKE pri_params-pdest,

l_f_spld LIKE usr01-spld,

l_f_layout LIKE pri_params-paart,

l_f_line_count LIKE pri_params-linct,

l_f_line_size LIKE pri_params-linsz,

l_f_out_parameters LIKE pri_params,

l_f_valid.

l_f_line_size = 255.

l_f_line_count = 65.

l_f_layout = 'X_65_255'.

l_f_list_name = sy-repid.

  • to get defult spool device for the user

SELECT SINGLE spld INTO l_f_spld FROM usr01 WHERE bname = sy-uname.

IF sy-subrc = 0.

MOVE l_f_spld TO l_f_destination.

ENDIF.

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

  • EXPIRATION = C_NUM1_UNKNOWN

immediately = 'X'

  • IN_ARCHIVE_PARAMETERS = ' '

  • IN_PARAMETERS = ' '

layout = l_f_layout

line_count = l_f_line_count

line_size = l_f_line_size

list_name = l_f_list_name

  • LIST_TEXT = C_CHAR_UNKNOWN

  • MODE = ' '

  • NEW_LIST_ID = 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

IMPORTING

  • OUT_ARCHIVE_PARAMETERS =

out_parameters = l_f_out_parameters

valid = l_f_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF l_f_valid NE space.

NEW-PAGE PRINT ON PARAMETERS l_f_out_parameters.

WRITE : /5 'Material No.',

25 'Message Type',

40 'Message Issued'.

ULINE.

LOOP AT g_t_message_table WHERE type = 'E'.

WRITE : / g_t_message_table-matnr UNDER 'Material No.',

g_t_message_table-type UNDER 'Message Type',

g_t_message_table-message UNDER 'Message Issued'.

ENDLOOP.

NEW-PAGE PRINT OFF.

ENDIF.

ENDFORM. " WRITE_TO_SPOOL

Regards

hassan_nia
Explorer
0 Kudos

For Smartforms, it is very easy:

Data:  l_output_options TYPE ssfcompop.

l_output_options-tdcovtitle is the spool title. You can put in it what you want (68 char).

shoul be filled before you call Function:

l_output_options-tdcovtitle = 'what you want to be shown in SPOOL as title'.

CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        output_options     = l_output_options
        control_parameters = l_control
        user_settings      = ' '
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.

Just let me know if you want the entire source code.