cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a Spool Order when PRINT PREVIEW is selected

bettinasilveira
Participant
0 Kudos

Hi!

In order to solve another problem I have, I need to find a solution to the following issue:

I need that when the user clicks on "Preview Print" at the print options of a SapScript, the system creates a spool order.

I'm getting a spool order only when the user PRINTs the form, not when the PRINT PREVIEW is selected.

There is a way to make the system to create a spool order, no matter if the user is printing or viewing the form???

Thanks in advance!

Bettina

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bettina,

To achieve this before calling smartforms function module, declare below data.

data: gst_control_parameters type ssfctrlop,
        gst_output_options type ssfcompop,
        gt_job_output_info type ssfcrescl,
        gt_output_options type ssfcresop.

Now before calling the generated smartforms function module pass below parameters

gst_control_parameters-no_dialog = 'X'.

gst_control_parameters-getotf = 'X'.

gst_control_parameters-preview = 'X'.

Finally pass the parameter as below

control_parameters = gst_control_parameters

output_options = gst_output_options

job_output_info = gt_job_output_info

job_output_options = gt_output_options

Regards

Abhii

Edited by: Abhii on Dec 10, 2009 4:48 PM

bettinasilveira
Participant
0 Kudos

My problem is with a SAPSCRIPT (as you can see in my previous post) not with a SMARTFORM.

Former Member
0 Kudos

Hi Bettina,

Sorry for my previous reply

While generating mstr_print_parms set NO_DIALOG = 'X' in the FM GET_PRINT_PARAMETERS.

Also set below parameters as specified

in_archive_parameters = SPACE

in_parameters = SPACE

Regards

Abhii

Edited by: Abhii on Dec 10, 2009 5:04 PM

Former Member
0 Kudos

Hi

I think u need to run your print twice if the user presses preview option.

So your code should be like:

CLEAR: ITCPO, ITCPP.
DO.
  CALL FUNCTION OPEN_FORM
     EXPORTING
        OPTIONS =  ITCPO
     IMPORTING
         RESULT = ITCPP.
* All code it needs to print the document and at the last  
   IF ITCPP-TDPREVIEW = 'X'.
* Here it needs to fill the structure ITCPO to be transfered to parameter OPTION   
   ELSE.
     EXIT.
  ENDIF.
ENDDO.

In the second run u need to fill the structure ITCPO in order to create the spool

Max

bettinasilveira
Participant
0 Kudos

I finally did that. I had no other option...

Thanks for your time!

Answers (0)