Hi experts,
i have small problem: I need to open a PDF-doc from a BSP without the annoying Pop-up 'do you want to save or open the Doc?'....
I have the following coding, but I just get an empty page in the same window...
Can you please help me?
CODING:
METHOD show_doc. DATA: lv_xfile TYPE xstring, lv_content_type TYPE string, lv_hlp_str TYPE string, lv_xdata_len TYPE i, lx_response TYPE REF TO cl_http_response, lx_navigation TYPE REF TO cl_bsp_navigation. lv_xfile = iv_xfile. IF iv_contenttype IS INITIAL. s_status-doc_type = iv_doctype. TRANSLATE s_status-doc_type TO UPPER CASE. "#EC TRANSLANG CALL METHOD get_content_type EXPORTING iv_doc_type = s_status-doc_type IMPORTING ev_content_type = lv_content_type. ELSE. lv_content_type = iv_contenttype. ENDIF. IF iv_len IS INITIAL. lv_xdata_len = XSTRLEN( lv_xfile ). ELSE. lv_xdata_len = iv_len. ENDIF. * Daten in die Response schreiben CREATE OBJECT lx_response TYPE cl_http_response EXPORTING add_c_msg = 1. lx_response->set_data( data = lv_xfile length = lv_xdata_len ). lx_response->set_header_field( name = 'Content-Type' value = lv_content_type ). lx_response->set_header_field( name = 'cache-control' value = 'max-age=0' ). CONCATENATE 'attachment; filename=' iv_filename INTO lv_hlp_str. lx_response->set_header_field( name = 'content-disposition' value = lv_hlp_str ). me->x_navigation->response_complete( ). * create object lx_navigation exporting runtime = me. CALL METHOD cl_bsp_utility=>download EXPORTING object_s = lv_xfile content_type = lv_content_type content_disposition = lv_hlp_str response = lx_response navigation = me->x_navigation . CALL METHOD me->x_navigation->response_complete( ). ENDMETHOD.