Skip to content

Latest commit

 

History

History
65 lines (57 loc) · 1.99 KB

README.md

File metadata and controls

65 lines (57 loc) · 1.99 KB

MIME Faker

No MIME Repository exists in ABAP Cloud. This solution helps to store files on the ABAP Stack and serves an "ABAP Standard" and "ABAP for Cloud" compatible solution. Of course this is not a real MIME Repository!

Approaches

  1. Store files as comments in an ABAP method
  2. Store files in a custom table
  3. ...?

Approach I

Use the interface:

INTERFACE z2ui5_if_mime_container
  PUBLIC.

  TYPES:
    BEGIN OF ty_s_metadata,
      name   TYPE string,
      format TYPE string,
      descr  TYPE string,
    END OF ty_s_metadata.

  METHODS get_metadata
    RETURNING
      VALUE(result) TYPE ty_s_metadata.

  "! Dummy Container, filled with file data as comments, don't use this!
  METHODS container.

ENDINTERFACE.

And store your file as a comment in the method "container":

  METHOD z2ui5_if_mime_container~container.
*{
*    "glossary": {
*        "title": "example glossary",
*        "GlossDiv": {
*            "title": "S",
*            "GlossList": {
*                "GlossEntry": {
*                    "ID": "SGML",
*                    "SortAs": "SGML",
*                    "GlossTerm": "Standard Generalized Markup Language",
*                    "Acronym": "SGML",
*                    "Abbrev": "ISO 8879:1986",
*                    "GlossDef": {
*                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
*                        "GlossSeeAlso": ["GML", "XML"]
*                    },
*                    "GlossSee": "markup"
*                }
*            }
*        }
*    }
*}
 ENDMETHOD.

Read your file as it is done in the sample app:
image

Demo

mime_faker

Approach II

Store Files in a z-table. No tranportation as a development object possible.