Showing results for 
Search instead for 
Did you mean: 

Handling Of Non-HTML Documents

Former Member
0 Kudos

Hi everyone,

for the PDF printout functionality in our BSPs we are using the technique described form Brian McKellar in this weblog:


It works great, but not in all systems.

We are on a 5 system landscape and it works in two systems. The coding is transportet thru all systems and is exactly the same in all systems.

I have implemented the test progamm from Brian and it works also only in the same two systems.

Now I have bought his book "Advanced BSP Programming", but it dose'nt help.

Maybe it depends on the ICM cache properties? Any ideas?

Thanks for the help!



Accepted Solutions (0)

Answers (2)

Answers (2)

Developer Advocate
Developer Advocate
0 Kudos

Please describe your problem. Is it in the generation of the PDF? Or in the use of the cached response. Is there anything different about these systems - release level, support package, kernel patch level, Unicode vs. Non-Unicode, etc.

Former Member
0 Kudos

Hi together,

I get the following error message:

Following error text processed in system:

BSP Exception: Das Objekt E3FF8C1DB39E2A448DB1CD3E3C93533C.pdf in der URL /sap(bD1lbiZjPTAwMSZzPVNJRCUzYUFOT04lM2FwcnZtYWluX1BSVl8wMCUzYV9QWHZRU2FWZXlEY2lZY2NCNTNWRVVFMXF1NXUta2JUUTducGdHalYtQVRUJmk9MSZ3PTQ5NTAwMDAr)/bc/bsp/sap/yy_chm_mm_opp/E3FF8C1DB39E2A448DB1CD3E3C93533C.pdf ist nicht gültig.

The generation of the PDF is ok. We are using Smart Forms and convert the OTR output via FUBA CONVERT_OTF into PDF.

The systems are on the same release level, support package, kernel patch and all are Unicode systems.

This is my coding: Method - DO_HANDLE_EVENT

*       --- fill HTTP response        CREATE OBJECT lr_cached_response               EXPORTING add_c_msg = 1.        lv_pdf_xstring = lv_content.        lv_pdf_len = XSTRLEN( lv_pdf_xstring ).        lr_cached_response->set_data( data   = lv_pdf_xstring                                   length = lv_pdf_len ).        lr_cached_response->set_header_field(           name  = if_http_header_fields=>content_type           value = 'application/pdf' ).        CALL METHOD lr_cached_response->if_http_response~set_status          EXPORTING            code   = 200            reason = 'OK'.        CALL METHOD      lr_cached_response->if_http_response~server_cache_expire_rel          EXPORTING            expires_rel       = 180*           ETAG              =*           BROWSER_DEPENDENT = ' '            .        CALL FUNCTION 'GUID_CREATE'          IMPORTING            ev_guid_32 = lv_guid_32.        CONCATENATE runtime->application_url '/' lv_guid_32 '.pdf'               INTO gv_display_url.        cl_http_server=>server_cache_upload( url = gv_display_url        response = lr_cached_response ).

I have checked my systems today, and now 3 of 5 system are ok. We don't changed the coding, the smart form and no updates are implementet on this system. I don't understand this behavior and maybe tomorrow I get the error again.

Any thought?

Regrads, Stephan

Developer Advocate
Developer Advocate
0 Kudos

Just a glance I don't see anything wrong with the coding. Your timeout already seems fairly high (180 seconds), so I don't think that the cache is expiring before the page reloads. However if you have a lot of activity on the server I supose the cache could fill and flush objects. It seems highly unlikely that this would occur in the short time frame it takes to load the page and access the cached response. I would check the ICM (SMICM) and make sure that there aren't a lot of errors or to see the size of the cache (number of objects).

How are you pushing the URL out the users. Does it go out immediately on page load in a iFrame or something like that? Or is it activated by clicking on a link or button? Could there be some delay when accessing the URL?

Former Member
0 Kudos

Hi Thomas,

the users have to click on a "Print" button. Then we have to create the smart form in a different system. We do this via a RFC-Call.

  CASE event.
    WHEN 'print'.

      lv_model = gr_model.
      IF lv_model IS BOUND.
*       --- set opportunity guid
        lv_guid = lv_model->gv_object_key.
*       --- set smart form
        lv_smart_form = gc_sf_mm_opp.
*       --- execute smartform in the crm system
          DESTINATION lv_model->gv_rfc_destination
            iv_guid      = lv_guid
            iv_smartform = lv_smart_form
            iv_language  = lv_model->gv_language
            ev_type      = lv_type
            ev_content   = lv_content
            ev_length    = lv_length.

*       --- fill HTTP response

This backend system is a non Unicode system, could this cause the problem?

Regards, Stephan

Former Member
0 Kudos

Hi everybody,

I located the problem, it's an authorisation problem of our RFC User. I request the missing authorisation for this user.

Tanks for you help, it took me on the right way.

Regrads, Stephan

Active Contributor
0 Kudos


Can you describe exactly what is going wrong? What type of error do you get?

Did you look for alternatives like described in