Skip to Content
author's profile photo Former Member
Former Member


Hello All,

I am new to BSP coding, Please help me how to solve my problem.

I have two buttons on my BSP page one is Upload and View

When Upload : I am uploading word document to SAP Table.

When View : i want to get the data from SAP table Which i recently uploaded and view it in the Word document format.

How can i do this/

Thanks in Advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 20, 2009 at 08:54 AM

    on click of the view button read the content (word document) from the sap tables and then

    in you oninputprocessing write the following code

    (i assume you have stored the file content in an xstring (rawstring) field. if not if its just string , in the below code instead of set_data method use set_cdata)

    data: cached_response type ref to if_http_response.
    data: file_content type xstring .  (for holding the file content read from the db table)
    data: display_url type string .
    create object cached_response type cl_http_response exporting
      add_c_msg = 1.
          cached_response->set_data( file_content ).
          cached_response->set_header_field( name  =
                                             value = 'application/msword' ).
          cached_response->set_status( code = 200 reason = 'OK' ).
          cached_response->server_cache_expire_rel( expires_rel = 180 ).
          call function 'GUID_CREATE'
              ev_guid_32 = guid.
          concatenate runtime->application_url '/' guid '.doc' into
          cl_http_server=>server_cache_upload( url      = display_url
          return .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.