You can access the request parameter from anywhere in the *_DPC_EXT class via:
mr_request_details->parameters
You can access the request parameter from anywhere in the *_DPC_EXT class via:
mr_request_details->parameters
METHOD /iwbep/if_mgw_appl_srv_runtime~get_stream.
* This method get's called when a media file is queried with $value. A binary stream will be returned.
TRY.
DATA(file_id) = VALUE zfile_id( it_key_tab[ name = 'file_id' ]-value ).
CATCH cx_sy_itab_line_not_found.
RETURN. " leave here when no file_id provided
ENDTRY.
DATA(ls_file) = get_file( file_id ) " read your file you want to return (if it's not yet a binary stream, convert it)
DATA(ls_stream) = VALUE ty_s_media_resource( value = ls_file-value
mime_type = ls_file-mimetype ). " in my case it's 'application/pdf'
" necessary to display the filename instead of $value in the viewer title
TRY.
" create pdf object
DATA(lo_fp) = cl_fp=>get_reference( ).
DATA(lo_pdfobj) = lo_fp->create_pdf_object( connection = 'ADC' ).
lo_pdfobj->set_document( pdfdata = ls_stream-value ).
" set title
lo_pdfobj->set_metadata( VALUE #( title = ls_file-filename ) ).
lo_pdfobj->execute( ).
" get pdf with title
lo_pdfobj->get_document( IMPORTING pdfdata = ls_stream-value ).
CATCH cx_fp_runtime_internal
cx_fp_runtime_system
cx_fp_runtime_usage INTO DATA(lo_fpex).
ENDTRY.
copy_data_to_ref( EXPORTING is_data = ls_stream
CHANGING cr_data = er_stream ).
" necessary for the pdf to be opened inline instead of a download (also sets the filename when downloaded)
/iwbep/if_mgw_conv_srv_runtime~set_header( VALUE #( name = 'content-disposition'
value = |inline; filename={ ls_file-filename }| ) ).
ENDMETHOD
Quick way to open a PDFViewer in your UI5 App:
const pdfViewer = new PDFViewer()
pdfViewer.setSource("/sap/opu/odata/ZMY_SEVICE" + my_path + "/$value") // my_path could be something like this "/PdfSet('file_id')"
pdfViewer.setTitle("My PDFViewer Title") // title of the popup, not the viewer
pdfViewer.open()
" Filter, Sort, Paging
/iwbep/cl_mgw_data_util=>filtering( EXPORTING it_select_options = it_filter_select_options
CHANGING ct_data = et_entityset ).
/iwbep/cl_mgw_data_util=>orderby( EXPORTING it_order = it_order
CHANGING ct_data = et_entityset ).
/iwbep/cl_mgw_data_util=>paging( EXPORTING is_paging = is_paging
CHANGING ct_data = et_entityset ).
DATA(lt_filter) = io_tech_request_context->get_filter( )->get_filter_select_options( ).
IF line_exists( it_filter[ property = 'MYKEY' ] ).
DATA(lv_input) = it_filter[ property = 'MYKEY' ]-select_options[ 1 ]-low.
" ...
ENDIF.
Transactions:
PTARQ | Testumgebung Abwesenheitsmitteilung |
PTCOR | Testumgebung Zeitbuchungskorrektur |
HCM Fiori OData Services:
Request database :
BAdI’s:
Leave Request Functionsmodules:
SE38:
SICF:
/sap/bc/ui5_ui5/sap/
/sap/opu/odata/sap/
und /sap/bc/bsp/sap/
Tcodes:
sicf | Pflege des HTTP-Service-Baums (SAP Internet Communication Framework) | |
segw | SAP Gateway Service Builder | |
/n/iwbep/view_log | SAP Gateway Protokoll-Viewer | |
/n/iwfnd/gw_client | SAP Gateway Client | |
/n/iwfnd/apps_log | SAP Gateway Anwendungsprotokoll-Viewer | |
/n/iwfnd/error_log | SAP Gateway Fehlerprotokoll | |
/n/iwfnd/maint_service | Services aktivieren und verwalten | |
/n/iwfnd/cache_cleanup | Bereinigung des Gateway-Modellcache (Frontend) | |
/n/ui2/cust | Customizing für UI-Technologien | |
/n/ui2/flp | SAP Fiori Launchpad | |
/n/ui2/flc | SAP Fiori Launchpad – Prüfungen | |
/n/ui2/flia | Fiori Launchpad: Absichtsanalyse | |
/n/ui2/flpd_cust | Fiori Launchpad: Designer (mandantenüber.) | /n/ui2/flpcm_cust (3170196) |
/n/ui2/flpd_conf | Fiori Launchpad: Designer (mandantenabh.) | /n/ui2/flpcm_conf (3170196) |
/n/ui2/flpcm/cust | FLP-Content-Manager | |
/n/ui2/flpcm/conf | FLP-Content-Manager | |
/n/ui2/semobj | Semantisches Objekt definieren – Kunde | |
/n/ui2/semobj_sap | Semantisches Objekt definieren – SAP | |
/n/ui2/theme_designer | UI Theme Designer | |
swfvisu | Workflow Visualisierungs-Metadaten | |
swfvmd1 | Workflow Visualisierungs-Metadaten |