cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve pdf spool request and display in BSP

Former Member
0 Kudos

How do I retrieve a spool request in ECC 6.0 that is already of type PDF, and display it in a BSP?

I see some similar unanswered questions on the forum, but am hoping someone will know how to do this.

Accepted Solutions (1)

Accepted Solutions (1)

former_member194669
Active Contributor
0 Kudos

Have you checked this Blog

/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp

I find this is much helpful

I think this needs to move Business server pagaes forum

Former Member
0 Kudos

Thanks a®s. It is already duplicate-posted without answers though, so I will move this one and reject the other to continue further...

Former Member
0 Kudos

The blog seems to be going the other direction -- from BSP to PDF. The "what the future holds" comment by Matthias Zeller mentions creating the pdf's directly using ADS, but it does not tell me how to get them out of the spool and into a BSP.

Answers (2)

Answers (2)

Former Member
0 Kudos

Function FPCOMP_CREATE_PDF_FROM_SPOOL worked as a®s said it would

Former Member
0 Kudos

Hi Janice,

Can you please let me know what do we need to pass in the paramater "I_PARTNUM" in the Function Module

FPCOMP_CREATE_PDF_FROM_SPOOL?

Where can I get the I_PARTNUM from? I have the spool number, but not able to determine how to get the I_PARTNUM.

Thanks in advance.

Regards,

Saleem

Former Member
0 Kudos

Saleem

I apologize. We're in the middle of year-end processing and upgrades right now. I do not have time to research how I found this value. We are using '1' for partnum. I may recall that I thought it should be '0', but it did not work. '1' (one) worked for me. It should relate to table TSP01.

Janice

Former Member
0 Kudos

Janice Ishee wrote :

We recently converted to ECC 6.0. In previous versions of SAP, Tax Reporter created spool files which were not pdf's. By getting the spool id rTSP01-RQIDENT, we could retrieve the spool file and convert to pdf using function CONVERT_OTFSPOOLJOB_2_PDF. Then I would display this pdf in an ITS application.

Now that we're in ECC 6.0, the Tax Reporter spool files are in table TSP01 as type pdf already. I want to re-write my old ITS application as a Business Server Page. When I've displayed a Smartform as a pdf in other Business Server Pages, I used some logic from a Thomas Jung blog or book whereby I would take the internal table job_output_info that comes back from the Smartform, call function CONVERT_OTF to get an XSTRING, and then the following logic:

* Convert the SmartForm into an Acrobat-renderable (PDF) format
* convert otf to pdf
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = l_pdf_len
      bin_file              = l_pdf_xstring
    TABLES
      otf                   = all_job_output_info
      lines                 = lt_lines
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      OTHERS                = 4.

  IF sy-subrc EQ 0.
    CREATE OBJECT cached_response
      TYPE
        cl_http_response
      EXPORTING
        add_c_msg        = 1.

    l_pdf_len = XSTRLEN( l_pdf_xstring ).
    cached_response->set_data( data   = l_pdf_xstring
                        length = l_pdf_len ).

    cached_response->set_header_field(
          name  = if_http_header_fields=>content_type
                      value = 'application/pdf' ).
    cached_response->set_status( code = 200 reason = 'OK' ).
    cached_response->server_cache_expire_rel( expires_rel = 180 ).

    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_32 = guid.

    CONCATENATE runtime->application_url '/' guid '.pdf'
    INTO me->query->display_url.

    cl_http_server=>server_cache_upload(
                    url      = me->query->display_url
                          scope    = ihttp_inv_global
                         response = cached_response ).
  ENDIF.

  me->call_view( view ).

So my question is, how do I now get the pdf-type spool file and display it in a BSP?

Edited by: Julius Bussche on Aug 17, 2009 10:31 PM