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

Sending PDF data to Spool/Printer

Former Member
0 Likes
10,148

Hi,

We have created a new device to use device type PDF1.

I am retreiving PDF content from SAP and trying the use the function module 'RSPO_SX_OUTPUT_DEVICEDATA' to send the PDF data to the spool.

I am getting a INTERNAL_SERVER Error.

Here is my function call: -

 

CALL FUNCTION 'RSPO_SX_OUTPUT_DEVICEDATA'

EXPORTING

 

* NAME =

 

dest = p_dest

 

* SIZE = l_rowbytes

* ROWS = w_lines

* STARTROW = 1

* pages = 1

* RQTITLE =

* RQCOPIES =

* RQOWNER =

 

datatype = 'RAW'

immediately = space

 

* IMPORTING

* RQID =

 

TABLES

device_data = t_hex

 

* EXCEPTIONS

* NAME_MISSING = 1

* NAME_TWICE = 2

* NOT_FOUND = 3

* ILLEGAL_LAYOUT = 4

* INTERNAL_ERROR = 5

* SIZE_MISMATCH = 6

* OTHERS = 7

.

I have also tried to process a smartform while specifying the output device as my new PDF device, but this appears on the spool as an OTF not a PDF. Should it be a PDF.

Any help is much appreciated.

Thanks

Martin

Hi,

We have created a new device to use device type PDF1.

I am retreiving PDF content from SAP and trying the use the function module 'RSPO_SX_OUTPUT_DEVICEDATA' to send the PDF data to the spool.

I am getting a INTERNAL_SERVER Error.

Here is my function call: -

 

CALL FUNCTION 'RSPO_SX_OUTPUT_DEVICEDATA'

EXPORTING

 

* NAME =

 

dest = p_dest

 

* SIZE = l_rowbytes

* ROWS = w_lines

* STARTROW = 1

* pages = 1

* RQTITLE =

* RQCOPIES =

* RQOWNER =

 

datatype = 'RAW'

immediately = space

 

* IMPORTING

* RQID =

 

TABLES

device_data = t_hex

 

* EXCEPTIONS

* NAME_MISSING = 1

* NAME_TWICE = 2

* NOT_FOUND = 3

* ILLEGAL_LAYOUT = 4

* INTERNAL_ERROR = 5

* SIZE_MISMATCH = 6

* OTHERS = 7

.

I have also tried to process a smartform while specifying the output device as my new PDF device, but this appears on the spool as an OTF not a PDF. Should it be a PDF.

Any help is much appreciated.

Thanks

Martin

3 REPLIES 3
Read only

Former Member
0 Likes
6,242

Hi Martin,

pls check below code.

IF NOT it_final[] IS INITIAL.       -


>IT_FINAL is my main internal table in the report ZSALARY

      DATA : count TYPE syprcop,

         days TYPE sypexpi,

         params TYPE pri_params,

         valid TYPE c,

      pdf_table TYPE  rcl_bag_tline,

      spoolid TYPE rspoid,

      pdf_fsize TYPE  i.

        CALL FUNCTION 'GET_PRINT_PARAMETERS'

          EXPORTING

            destination    = 'LP01'

            copies         = count

            list_name      = 'ZSALARY'   -


tHIS IS MY REPORT NAME

            list_text      = 'ZSSPOOL'

            immediately    = ' '

            release        = 'X'

            new_list_id    = 'X'

            expiration     = days

            line_size      = 90

            line_count     = 65

            layout         = 'X_PAPER'

            sap_cover_page = 'X'

            receiver       = 'SAP*'

            department     = 'System'

            no_dialog      = 'X'

          IMPORTING

            out_parameters = params

            valid          = valid.

        NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.

        WRITE : 'hi this is the test for spool'.

        NEW-PAGE PRINT OFF.

        COMMIT WORK.

        WRITE : / 'The Spool no is ', sy-spono. "system variable for spool no

        spoolid = sy-spono   .       -


At this point i can see the spool no.

        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

          EXPORTING

            src_spoolid   = spoolid

            no_dialog     = 'X'

          IMPORTING

            pdf_bytecount = pdf_fsize

          TABLES

            pdf           = pdf_table

          EXCEPTIONS

            OTHERS        = 0.

        CHECK sy-subrc = 0.

Thanks

Tarak

Read only

0 Likes
6,242

I already have the PDF content. I need to use the function module RSPO_SX_OUTPUT_DEVICEDATA to send the PDF content to the spool/printer, but I do not know if I am using it properly.

Do I need to populated the number of pages etc.

Thanks

Martin

Read only

CreyJ
Participant
6,242

Hello Martin,

SAP provides a function module ADS_CREATE_PDF_SPOOLJOB, that can put an PDF in the SAP spool system. Example program is FP_TEST_SAVE_PDF_TO_SPOOL.

If not available, check note 0001855522.

Regards

Jürgen