Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Logo/Image From MIME repository in report output

$
0
0

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

       image.jpg

  • Right click on this folder and click on import MIME object.

       image1.jpg

 

  • 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

       image2.jpg

 

  • Now we need to create a program to display an ALV output which is based on
    the requirement. An example is shown below

      image3.jpg    

 

  • We have provided a button “Image” for input so on click on this button the
    image will be displayed in ALV output

      image4.jpg    

 

  • 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.

       image5.jpg

 

Key Benefits

  1. Any additional information which would help the end user can be display in
    the output itself
  2. This can also be served as an verification method for certain process such
    as invoice verification
  3. This image display can be made dynamic based on the requirement
  4. Since MIME repository is used we can also mass import and export from/to local
    folders.
  5. The maintenance transaction SE80 offers greater comfort than SMW0 (Web
    Repository). It is used by SAP for Web Dynpro and BSP applications.

 

Reference

 

  1. https://help.sap.com/saphelp_crm50/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm
  2. https://help.sap.com/saphelp_crm50/helpdata/en/46/bb183eab4811d4968100a0c94260a5/content.htm

 

Contact Details

 

Name: Shravan Uddaram

Email: shravan.k.uddaram@accenture.com


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>