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: 

How to create a PDF output which is in binary data to Spool request, so we can select print spool to print the pdf

Former Member
0 Kudos
1,771

Please help with a solution to print the PDF content which is available in binary format to SPOOL request for print.

In Web UI, on click of a custom print button in a view, I select the custom developed PDF form and get the form output in Binary Data.

4 REPLIES 4

former_member491621
Contributor
0 Kudos
462

Hi Raja,

You can check the below links

https://scn.sap.com/message/5814646

http://scn.sap.com/message/8715149

Hope this helps

0 Kudos
462

These function modules did not help.

Here is the problem, In Web UI, I can read the header document which has a PDF created into a binary internal table using method,

        CALL METHOD cl_crm_documents=>get_with_table
          EXPORTING
            phio                = phio
          IMPORTING
            file_content_binary = itab_file_content_binary
            error               = kw_error.

This binary data is the pdf I need to schedule a job which prints this content.

FM RSPO_SR_OPEN, created the spool request, trying to find a FM to write the binary content to spool request.

I tried FM like RSPO_SR_TABLE_WRITE_BINARY & SLVC_TABLE_PS_TO_SPOOL but pages are 0.

FM CONVERT_ABAPSPOOLJOB_2_PDF has the tables parameter of data type TLINE which is 132 where as itab_file_content_binary is 1044.

OR

From the FM FP_JOB_OPEN, FP_FUNCTION_MODULE_NAME, I execute the FM to get PDF in RAWSTRING

    CALL FUNCTION  le_fm_name "'/1BCDWB/SM00000005'
     EXPORTING
       /1bcdwb/docparams        = le_fp_docparams
     IMPORTING
       /1bcdwb/formoutput       = le_formoutput
     EXCEPTIONS
       usage_error              = 1
       system_error             = 2
       internal_error           = 3
       OTHERS                   = 4.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

I need to try writing le_formoutput-pdf into spool request.

Please suggest some solution to have the content transferred to the spool created.

0 Kudos
462

This message was moderated.

0 Kudos
462

This message was moderated.