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: 

Spool request for SAP Script

Former Member
0 Kudos

Hi all,

I am new in abap. can anyone tell me how to create spool request for SAP Script output. Give me details about spool request i.e. where to find that request.

Plz do needful.

4 REPLIES 4

abapdeveloper20
Contributor
0 Kudos

Hi Ramesh,

Check the TCODE SP01 SP02 etc are used for spool . Any one can use this tcodes

You can maintain the spools: delete, print, save local file etc.

TSP01 is the table.

Any of your objects that you give for print are stored as spools in this Tcode. Sometimes based on the attributes you set spool gets created and then deleted. Or you can retain the spool.

Goto SP01 and give your Uname and you can check the spool id's over there. Click on them to see the content.

Reward points if reply helps.

~Lakshmiraj~

Former Member
0 Kudos

Hi,

Do the steps.

Goto SE38>PROGRAM NAME>PROGRAM>EXECUTE>EXECUTE IN BACKGROUND-->GOTO SP01.

U CAN VIEW THE OUTPUT.

PROVIDED U MUST PASS THE OPTIONS IN

U must do the following changes in the program in which script is called.

TABLES : ITCPO.

 itcpo-tdcopies = '1'.
  itcpo-tddest = 'PRINTDEVICE'.
  itcpo-tdnewid = 'X'.
  itcpo-tdimmed = 'X'.
  itcpo-tdtitle = 'TITLE'.
  itcpo-tdtest = ' ' .
  itcpo-tdgetotf =  ' ' .
  itcpo-tdcovtitle = 'TEST.'.
*TCPO-TDNOPREV = 'X'.
  itcpo-tdsuffix1 = 'TEST'.
  itcpo-tddelete = ' '.
  itcpo-tdiexit = 'X'.


CALL FUNCTION 'OPEN_FORM'

      EXPORTING
*         APPLICATION        = 'TX'
*         ARCHIVE_INDEX      = ' '
*         ARCHIVE_PARAMS     = ' '
*       DEVICE             = ' '
          dialog             = disp
           form               = 'ZSCRIPT'
           language           = sy-langu
            OPTIONS            = itcpo
      IMPORTING
*         LANGUAGE           =
*         NEW_ARCHIVE_PARAMS =
           RESULT             = itcpp
       EXCEPTIONS
            canceled           = 1
            device             = 2
            form               = 3
            OPTIONS            = 4
            unclosed           = 5
            OTHERS             = 6.

Regards,

Morris Bond.

Reward Points if Helpful.

Former Member
0 Kudos

Hi,

Spool Request in Transaction SP01 and there by generated a Spool Request Number.

Spool request is a document for which a print function has been selected. However, it has not yet been output to a printer or another device. The output data for the print document is stored partly formatted in a data store until an output request is created, that is, until it is sent to a particular output device.

The spool system uses a spool request to store the print data temporarily and to access it. The data is stored in a temporary format. You can also display the print document. The system automatically assigns a 10-digit ID number to a spool request.

Output request: From the point of view of the SAP spool system, an output request outputs the print data of a spool request to a particular output device.

Multiple output requests may exist for a single spool request. Each represents an instance of the output of the same spool request. Each of these output requests may have different attributes, such as the target printer or number of copies.

By differentiating between spool request and output requests, the spool system provides a means of storing the data temporarily.

You will get the spool no. in the parameter JOB_OUTPUT_INFO after calling the smartform function module in print program. The spool ids of the prints is stored in table JOB_OUTPUT_INFO-SPOOLIDS.

Also if this spool is being generated internal to your program, then SY-SPONO should have the value.

.................................................................

..................................................................

You need to create an Adobe Form Application, get the data from the backend based on Spool request number.

You can create an application in Webdynpro, wherein when you click on a button and the Adobe Form is displayed with all the data from the backend and you should be able to print it.

Does that answer your question ?

Cheers,

PANKAJ

venkat_o
Active Contributor
0 Kudos

Hi, When you print using SAP Script for the transaction, Check just CLOSE_FORM. It gives you spool information. Check the following code .

data:w_ITCPP type ITCPP.
CALL FUNCTION 'CLOSE_FORM'
 IMPORTING
    RESULT                         = w_ITCPP "This gives Spool information 
*   RDI_RESULT                     =
* TABLES
*   OTFDATA                        =
* EXCEPTIONS
*   UNOPENED                       = 1
*   BAD_PAGEFORMAT_FOR_PRINT       = 2
*   SEND_ERROR                     = 3
*   SPOOL_ERROR                    = 4
*   CODEPAGE                       = 5
*   OTHERS                         = 6
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards, Venkat.O