Preface – This post is part of the SAP ABAP OData Tutorial series.
This article will give a bare minimum to read and upload media files or MIME in SAP OData service.
Table of Contents
Procedure
- Create OData service
- Register service
- Execute service
Steps
- Create OData
- Select EntityType and select checkbox ‘Media’
- Generate runtime artifact. In MPC ext class redefine the DEFINE method.
- Redefine method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_STREAM .
- Redefine method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM .
- Redefine method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~UPDATE_STREAM .
- Redefine method FILESET_GET_ENTITYSET.
- Register OData service
- Execute
1. GET_STREAM is used to download the media
/sap/opu/odata/sap/ZMIMEFILE_SRV/File(Mandt=’100′,Filename=’mobile.jpg’)/$value.
2. CREATE_STREAM is used to upload the media
/sap/opu/odata/sap/ZMIMEFILE_SRV/File
Features
List of supported MIME Types that can be stored in MIME Repository:
Category/Subcategory | File Extension | Description | |
texts | text/css | css | CSS stylesheet file |
text/html | html, htm | HTML file | |
text/javascript | js | JavaScript file | |
text/plain | txt, c, cc, g, h, hh, m, f90 | Plain text file | |
text/richtext | rtx | MIME rich text | |
text/xml | xml | XML file | |
Images | image/gif | gif | GIF graphic |
image/ief | ief | Exchange Format | |
image/jpeg | jpeg, jpg, jpe | JPEG graphic | |
image/x-rgb | rgb | RBG graphic | |
image/x-windowdump | xwd | X-Windows dump | |
image/tiff | tiff, tif | TIFF graphic | |
image/bmp | bmp | Icon | |
image/ico | ico | Icon (Windows) | |
Audio | audio/basic | au, snd | AU and SND sound files |
audio/x-aiff | aif, aiff, aifc | AIFF sound file | |
audio/x-aiff | midi, mid | MIDI file | |
audio/x-pn-realaudio | ram, ra | RealAudio file | |
audio/x-pn-realaudio-plugin | rpm | RealAudio plug-in file | |
Video | video/mpeg | mpeg, mpg, mpe | MPEG video |
video/x-msvideo | avi | Microsoft AVI video | |
video/x-sgi-movie | movie | Microsoft SGI video | |
video/quicktime | qt, mov | Quicktime video | |
Applications | application/acad (NCSA) | dwg | AutoCAD file |
application/dxf (CERN) | dxf | AutoCAD file | |
application/mif | mif | Maker Interchange Format (Adobe FrameMaker) | |
application/msword | doc, dot | MS Word file | |
application/mspowerpoint | ppt, ppz, pps, pot | MS PowerPoint file | |
application/msexcel | xls, xla | MS Excel file | |
application/mshelp | hlp, chm | MS Windows help file | |
application/octet-stream | com, exe, bin, dll, class | Executable file or program code file | |
application/pdf | PDF file (Adobe Acrobat Exchange/Reader) | ||
application/postscript | ai, eps, ps | Postscript file (Adobe) | |
application/rtf | rtf | RTF file (Microsoft) |
0 Comments