Application Development and Automation 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: 
Read only

Send archived object to spool

Former Member
0 Likes
2,371

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

6 REPLIES 6
Read only

roberto_vacca2
Active Contributor
0 Likes
1,662

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

Read only

0 Likes
1,662

Unfortunately this FM does not exist in my system

Read only

0 Likes
1,662

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

Read only

0 Likes
1,662

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

Read only

0 Likes
1,662

Hi.

Try Host Spool Access F ( Printing on Front End Computer) or G

Others settings should be ok.

Hope to help.

Read only

Former Member
0 Likes
1,662

Hi Tim,

Did you check FM RSPO_OUTPUT_DEVICEDATA?

There is a good documentation also available on SE37.

R