‎2007 Apr 24 6:51 AM
HI all,
I have the spool number. Using the spool number, how can i print the output to a particular printer.
Suggestions please,
Rajesh.
‎2007 Apr 24 6:53 AM
‎2007 Apr 24 6:54 AM
check SP02 ---> for a given spool number --->double click on spoll number --->here u can change printers.
Regards
Prabhu
‎2007 Apr 24 6:54 AM
I retrieve the spool number from table tsp01. How can I print the output from my abap program.
Thanks,
Rajesh.
Message was edited by:
Rajesh Kumar.
‎2007 Apr 24 7:05 AM
Take help of the following code:
v_print = 'X' only for printing else it is space
first setup print parameters..
* Setup the Print Parmaters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
AUTHORITY = SPACE
IMMEDIATELY = V_PRINT
NEW_LIST_ID = C_X
NO_DIALOG = C_X
USER = SY-UNAME
IMPORTING
OUT_PARAMETERS = V_PRINT_PARMS
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF SY-SUBRC NE 0.
CLEAR : V_PRINT_PARMS.
ENDIF.
* The printer destination has to be set up
IF V_PRINT_PARMS-PDEST = SPACE.
V_PRINT_PARMS-PDEST = LC_LOCL.
ENDIF.
* Explicitly set line width, and output format so that
* the PDF conversion comes out OK
V_PRINT_PARMS-LINSZ = C_LINSZ.
V_PRINT_PARMS-PAART = LC_PAART.
then u need to write the below comand..
NEW-PAGE PRINT ON PARAMETERS V_PRINT_PARMS NO DIALOG.
perform output_display.
NEW-PAGE PRINT OFF.
‎2007 Apr 24 7:06 AM
Otherwise you can take the help of the following standard program:
<b>RSTXPDFT4</b>
‎2007 Apr 24 7:15 AM
Hi abhisek,
Where are you passing the spool number to printed, in your program.
Thanks,
rajesh.
‎2007 Apr 24 7:25 AM
IN the report:RSTXPDFT4
There is a option "Spool request" on the selectionscreen.
‎2007 Apr 24 7:29 AM
In the above report. It using a FM 'CONVERT_OTFSPOOLJOB_2_PDF' . Here you can pass the spool no to Exporting parameter SRC_SPOOLID.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
<b>SRC_SPOOLID = spoolno </b>
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
OTF_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
‎2007 Apr 24 8:00 AM
Hi Abishek,
Sorry for the delay in reply.
The Function module is to generate a pdf file. I want to print a particular spool data to a particular printer.
Thanks,
Rajesh.