Introduction
The MIME (Multipurpose Internet Mail Exchange) Repository is used to store objects such as style sheets, graphics, and icons in the SAP System. MIMEs are created as objects in the SAP database and can be referred to on the pages of BSP (Business Server Pages) applications. These objects use the SAP development infrastructure. Changes in the MIME Repository, such as the import of new MIMEs, are written to a transport request.
To display an image/chart/icon along with the report output onto a screen we can utilize this option of MIME repository to display the image. We can do this based on the information provided in the following document.
Business Scenario
To display a Pie chart on the left of the report output on click of a button.
Procedure
- Create a new folder called ‘ABAP’ under public as shown below
- Right click on this folder and click on import MIME object.
- Select an object from the suitable location and then provide the name,
description and click on save button. It will prompt for package and workbench
request. Provide the details and click on proceed so that the object is
uploaded to MIME repository. Here we have uploaded image with the name ‘Pie.jpg’
as shown below
- Now we need to create a program to display an ALV output which is based on
the requirement. An example is shown below
- We have provided a button “Image” for input so on click on this button the
image will be displayed in ALV output
- On click of the image button we create a docking container in the program
which serves to display this image. We use the ABAP global class ‘cl_mime_repository_api’
and its method ‘if_mr_api~get_api’ to create an API instance.
- We convert the xstring data to binary data. Then we create a temporary URL for
this data using function module 'DP_CREATE_URL' and load the URL using load_picture_from_url_async
method.
- Now on click on this button, the image is displayed on the left hand side
of the ALV output as shown below. This image can also be shown on the right
hand side based on the requirements.
Key Benefits
- Any additional information which would help the end user can be display in
the output itself - This can also be served as an verification method for certain process such
as invoice verification - This image display can be made dynamic based on the requirement
- Since MIME repository is used we can also mass import and export from/to local
folders. - The maintenance transaction SE80 offers greater comfort than SMW0 (Web
Repository). It is used by SAP for Web Dynpro and BSP applications.
Reference
- https://help.sap.com/saphelp_crm50/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm
- https://help.sap.com/saphelp_crm50/helpdata/en/46/bb183eab4811d4968100a0c94260a5/content.htm
Contact Details
Name: Shravan Uddaram