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: 

Generate spool request directly

former_member1349771
Participant
0 Kudos
295

My requirement is that as soon as user click on Execute(F8) automatically a spool request is generated without asking for PRINT & PRINT PREVIEW.

SUBMIT z_mm_rpt_problem_mgmt_prnt

TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS mstr_print_parms

WITH p_reqno = it_zprohdr-requestno

AND RETURN.

this is asking for PRINT & PRINT PREVIEW and sometimes no spool is generated for the documents which exits.

What could be the error.

Regards.

Edited by: ABHUT on May 9, 2009 9:12 AM

5 REPLIES 5

Former Member
0 Kudos
81

While creating "mstr_print_parms" set NO_DIALOG = 'X' like the example given below


  CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
            AUTHORITY              = SPACE
            COPIES                 = '1'
            COVER_PAGE             = SPACE
            DATA_SET               = SPACE
            DEPARTMENT             = SPACE
            DESTINATION            = SPACE
            EXPIRATION             = '1'
            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         = MSTR_PRINT_PARMS
            VALID                  = MC_VALID
       EXCEPTIONS
            ARCHIVE_INFO_NOT_FOUND = 1
            INVALID_PRINT_PARAMS   = 2
            INVALID_ARCHIVE_PARAMS = 3
            OTHERS                 = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
  IF MSTR_PRINT_PARMS-PDEST = SPACE.
    MSTR_PRINT_PARMS-PDEST = 'LOCL'. "'ZPDF'.
  ENDIF.
*-- Explicitly set output format so that
*-- the PDF conversion comes out OK
  IF P_PAART IS INITIAL.
    P_PAART = 'X_65_255'.
  ENDIF.
  MSTR_PRINT_PARMS-PAART = P_PAART.
  MOVE SY-REPID TO W_REPID.

0 Kudos
81

I hav defined in this manner

*-- Setup the Print Parmaters

{

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

authority = space

copies = '1'

cover_page = space

data_set = space

department = space

destination = space

expiration = '1'

immediately = space

  • in_archive_parameters = ' '

  • in_parameters = ' '

layout = space

mode = space

new_list_id = 'X'

no_dialog = 'X'

user = sy-uname

IMPORTING

out_parameters = mstr_print_parms

valid = mc_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

*-- Make sure that a printer destination has been set up

*-- If this is not done the PDF function module ABENDS

IF mstr_print_parms-pdest = space.

mstr_print_parms-pdest = 'SAPW'.

ENDIF.

  • Setting PList Param

CONCATENATE sy-repid0(9) sy-uname0(3) INTO mstr_print_parms-plist .

}

0 Kudos
81

then set the following to space too


 in_archive_parameters = SPACE
 in_parameters = SPACE

and check in debug what is the value of MSTR_PRINT_PARMS-PAART , if it is initial then u need to give some values.

Edited by: Tripat Pal Singh on May 9, 2009 10:07 AM

0 Kudos
81

In output a SAP SCRIPT is being generated.

MSTR_PRINT_PARMS-PAART what will be assigned.

0 Kudos
81

That u have to see what Print parameters, print formatting ur system has, but i suppose X_65_255 is standard, check my previous post