There will be times when you want to combine several forms into a single print job. Perhaps you want to print multiple copies of several different labels. Moreover, these labels need to be printed in a specific order. If each label is printed using a separate Spool Request then it is possible for the labels to print out of order. To get started, it is important to understand the difference between Print Requests and Spool Requests.
Print Requests vs. Spool Requests
SAP SmartForms allows you to combine several forms into one output unit called a print request. A print request is different from a spool request. A new spool job is created in the spool depending upon the settings in the spool dialog.
A new Print Request is created depending upon the standard parameters of the generated function module you set in SAP Smart Forms. It is important to note that for each Print Request, the spool dialog is called only once. By suppressing the dialog, you can pass parameters for spool processing only at the beginning of the Print Request.
This means that a Print Request can combine several forms before submitting them to spool processing. Thus they cannot be spread over several spool requests. However, you can include several Print Requests into one Spool Request.
1. Obviously, you will need to call Function Module: SSF_FUNCTION_MODULE_NAME and retrieve the name of the function module generated from the Smart Form.
2. Call the SmartForm for the first time setting the NO_CLOSE parameter of the control structure to ‘X’. This will prevent the Print Request from being closed after accepting the output of the SmartForm. This will also allow you to combine other form output into the Print Request. Just make sure to set the NO_OPEN parameter to blank ‘ ‘.
Note: You can call the Function Module: SSF_OPEN instead of calling the SmartForm for the first time.
Note: Set the parameter TDNEWID of the Output Options the first time if a new Spool Request is desired,
3. Use a LOOP statement for all other form output that you want to include in the Print Request and set the parameters NO_OPEN and NO_CLOSE of the control structure.
4. Close the Print Request by calling the last SmartForm with the parameter NO_OPEN = ‘X’ and unmark the NO_CLOSE parameter.
Note: You can call the Function Module: SSF_CLOSE instead of calling the SmartForm for the last time.
By following these steps, all of the forms that you print will be included into a single Print Request. If you decide to created a new Spool Request also, you will be able to view the output and the status using Transaction: SP01.