2015 Sep 08 11:02 AM
Hi,
I am using FM ARCHIVOBJECT_GET_TABLE to get an archived object (pdf file). The received object needs to be send to the spool for printing. I am using FM SCMS_BINARY_TO_XSTRING for further conversion of the file and then the FMs ADS_SR_OPEN, WRITE_TO_FILE, *CONFIRM and *CLOSE but the spool is not readable/printable at all.
Does anyone know an approach for this requirement? So archived PDF -> Spool for printing.
Thanks in advance,
Tim
Hi,
I am using FM ARCHIVOBJECT_GET_TABLE to get an archived object (pdf file). The received object needs to be send to the spool for printing. I am using FM SCMS_BINARY_TO_XSTRING for further conversion of the file and then the FMs ADS_SR_OPEN, WRITE_TO_FILE, *CONFIRM and *CLOSE but the spool is not readable/printable at all.
Does anyone know an approach for this requirement? So archived PDF -> Spool for printing.
Thanks in advance,
Tim
2015 Sep 08 11:20 AM
Hi.
Once you have your xstring table you'll need to :
CALL FUNCTION 'ADS_CREATE_PDF_SPOOLJOB'
EXPORTING
printer = 'LOCL' "Printer name supporting PDF device type
* DEST =
pages = 1
pdf_data = lv_pdfsource "XSTRING internal table
IMMEDIATE_PRINT = 'X' "Or what you want
* IMPORTING
* SPOOLID =
* EXCEPTIONS
* NO_DATA = 1
* NOT_PDF = 2
* WRONG_DEVTYPE = 3
* OPERATION_FAILED = 4
* CANNOT_WRITE_FILE = 5
* DEVICE_MISSING = 6
* NO_SUCH_DEVICE = 7
* OTHERS = 8
Try this. Hope to help
Bye
2015 Sep 08 11:33 AM
2015 Sep 08 11:55 AM
Well, it's a FM that involves your listed FM, in that case, trying always this road, you can follow this sequence:
IF printer IS NOT INITIAL.
SELECT SINGLE patype FROM tsp03d INTO patype WHERE name = printer.
ELSE.
IF dest IS NOT INITIAL.
SELECT SINGLE name patype FROM tsp03d INTO (printer, patype) WHERE
padest = dest.
ENDIF.
ENDIF.
CALL FUNCTION 'ADS_GET_DEVTYPE_ATTRIBUTES'
CALL FUNCTION 'ADS_SR_OPEN'
CALL FUNCTION 'ADS_WRITE_TO_FILE'
CALL FUNCTION 'ADS_SR_CONFIRM'
CALL FUNCTION 'ADS_SR_CLOSE'
The other solution can be save locally your pdf and launch the native print program from ABAP.
Hope to help
2015 Sep 11 10:16 AM
Hi,
I managed now to create the spool and I can open the PDF document in the spool. But now the problem is the printing. I have tried to maintain SPAD but I get an error message saying the MESSAGE FROM HOST SPOOL - UNABLE TO INITIALIZE DEVICE TEST. Any ideas on this?
In SPAD i have set device type PDF1; Host spool access L.
Thanks,
Tim
2015 Sep 14 11:31 AM
Hi.
Try Host Spool Access F ( Printing on Front End Computer) or G
Others settings should be ok.
Hope to help.
2015 Sep 08 12:20 PM
Hi Tim,
Did you check FM RSPO_OUTPUT_DEVICEDATA?
There is a good documentation also available on SE37.
R
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |