‎2011 May 09 6:12 AM
Hi
I have a problem in printing using SUBMIT.
I have three printers identified to print certain orders using submit statement.
the list of printers is given in a drop down and once the user selects a printer from the list, i have to generate a spool for the corresponding printer. But this is not happening. The spool is generated for the user's default printer defined in SU50. I have my submit statement below:
SUBMIT zppprbsel WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
TO SAP-SPOOL
*SPOOL PARAMETERS l_dest
WITHOUT SPOOL DYNPRO
WITH DESTINATION = l_dest
WITH IMMEDIATELY = SPACE
WITH KEEP_IN_SPOOL = 'X'
VIA JOB v_job_name
NUMBER v_job_cnt
AND RETURN.
here my l_dest has one of the three printers that the user selects.
when i change my default printer to one of the three printers the spool is generated fine. A spool always generated for the default printer of the user?
‎2011 May 09 6:23 AM
Hi,
Before the SUBMIT get the PRINT PARAMETER by using the FM --> GET_PRINT_PARAMETERS
IMPORTING
out_parameters = print_parametersprint_parameters-pdest = 'LOCL'. " Change the Destination before passsing the PRINT_PARAMETER to SUBMIT.
Then pass the print_parameters from the FM to the SUBMIT
SUBMIT zppprbsel WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
TO SAP-SPOOL
SPOOL PARAMETERS print_parameters "Pass here
WITHOUT SPOOL DYNPRO
WITH DESTINATION = l_dest
WITH IMMEDIATELY = SPACE
WITH KEEP_IN_SPOOL = 'X'
VIA JOB v_job_name
NUMBER v_job_cnt
AND RETURN.Regards,
Madhukar Shetty
‎2011 May 09 6:23 AM
Hi,
Before the SUBMIT get the PRINT PARAMETER by using the FM --> GET_PRINT_PARAMETERS
IMPORTING
out_parameters = print_parametersprint_parameters-pdest = 'LOCL'. " Change the Destination before passsing the PRINT_PARAMETER to SUBMIT.
Then pass the print_parameters from the FM to the SUBMIT
SUBMIT zppprbsel WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
TO SAP-SPOOL
SPOOL PARAMETERS print_parameters "Pass here
WITHOUT SPOOL DYNPRO
WITH DESTINATION = l_dest
WITH IMMEDIATELY = SPACE
WITH KEEP_IN_SPOOL = 'X'
VIA JOB v_job_name
NUMBER v_job_cnt
AND RETURN.Regards,
Madhukar Shetty
‎2011 May 09 6:38 AM
Set default print parameters for Spool
CALL FUNCTION 'SET_PRINT_PARAMETERS'
EXPORTING
destination = l_dest
line_size = l_linsz.
SUBMIT zppprbsel WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
TO SAP-SPOOL
SPOOL PARAMETERS l_dest
WITHOUT SPOOL DYNPRO
WITH DESTINATION = l_dest
WITH IMMEDIATELY = SPACE
WITH KEEP_IN_SPOOL = 'X'
VIA JOB v_job_name
NUMBER v_job_cnt
AND RETURN.
i put that and still i get the same result... spool is generated to my default printer and not the printer i selected...
‎2011 May 09 7:22 AM
Hi,
please try
SUBMIT zppprbsel
WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
VIA JOB v_job_name
NUMBER v_job_cnt
TO SAP-SPOOL
DESTINATION = l_dest
IMMEDIATELY = SPACE
KEEP_IN_SPOOL = 'X'
WITHOUT SPOOL DYNPRO
AND RETURN.What's the result?
Regards,
Klaus
‎2011 May 09 7:39 AM
I tried the above logic as well. My printer is still getting the spool and not the selected printer.
‎2011 May 09 7:43 AM
Sorry,
had a mistake with "="!
Correction:
SUBMIT zppprbsel
WITH aufnr EQ p_wa_batch_res_process_order
WITH werks EQ c_1201 "'1201'
WITH relvn EQ c_0 "'00000000'
WITH relbs EQ c_0 "'00000000'
WITH orig EQ ' '
WITH nach EQ c_x "'X'
VIA JOB v_job_name
NUMBER v_job_cnt
TO SAP-SPOOL
DESTINATION l_dest
IMMEDIATELY SPACE
KEEP_IN_SPOOL 'X'
WITHOUT SPOOL DYNPRO
AND RETURN.You have to remove SPOOL PARAMETERS if you pass destination and other parameters and you must'nt pass spool parameters with "WITH" or "=" ...
Regards,
Klaus
‎2011 May 09 7:57 AM
Hi,
Just a thought.. Please see the default parameters... SYSTEM->USERPROFILE->OWNDATA.. here the you might be having the default printer.. Please keep it blank and see ,also try to put one of the three printers there and see..
Regards,.
Nagaraj
‎2011 May 09 8:33 AM
When i change my default printer to the required printer, the spool is generating fine. but if i dont change it to the printer i need then also my default printer gets the spool.
‎2011 May 09 8:39 AM
Hi,
You can specify one printer at one time.. You cannot use both of them.So use one printer.
Regards,
Nagaraj
‎2011 May 09 9:47 AM
Actually my requirement is like no matter what my default printer set up is, spool should be generated only for the printer that i select in my report.... i am not able to achieve this..... always spool gets generated to my default printer only...
‎2011 May 09 10:16 AM
Hi Ramya,
This is what i am saying..In place of default printer give the printer which you want out of the three so that it will work for you.. it won't work for other two printers.. else go for one more approach.. don't have any default printer and in the program use "SET_PRINT_PARAMTERS' and 'GET_PRINT_PARAMTERS' and tehre specify the printer and see.
Regards,
Nagaraj