ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ICF - Internet Communication Framework → ICF Examples
Accessing the MIME Repository from a HTTP Service
This example demonstrates how the MIME repository is accessed using an HTTP service in ICF.
Other versions:
7.31 | 7.40 | 7.54
Source Code
IF icf_node IS INITIAL.
RETURN.
ENDIF.
DATA(url) = icf_node
&& `?sap-client=`
&& sy-mandt
&& `&sap-language=`
&& cl_i18n_languages=>sap1_to_sap2( sy-langu ).
DATA(url_icf) = url && `&mime_access=icf`.
DATA(url_api) = url && `&mime_access=api`.
cl_demo_output=>display_html(
|<html>| &&
|<body>| &&
|Link to HTTP-Service getting picture from ICF:
| &&
|<a href="{ url_icf }" target="_blank">{ url_icf }</a>
| &&
|Link to HTTP-Service getting picture from API:
| &&
|<a href="{ url_api }" target="_blank">{ url_api }</a>
| &&
|</body>| &&
|</html>| ).
Description
The HTTP service /sap/bc/abap/demo_mime can be called with different contents of the form field mime_access of the URL:
- If the form field has the value icf, the handler class CL_HTTP_EXT_MIME_DEMO creates an HTML file. This file points to an image in the MIME repository (as described in a different executable example).
- If the form field has the value api, the handler class CL_HTTP_EXT_MIME_DEMO creates the HTML file and also the image that is referenced in the HTML file. The image is loaded and forwarded using MIME-API.