Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oblomov-dev/mime-faker

Store Files on the ABAP Stack
https://github.com/oblomov-dev/mime-faker

abap abap2ui5 ui5

Last synced: 13 days ago
JSON representation

Store Files on the ABAP Stack

Awesome Lists containing this project

README

        

# 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:
```abap
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":
```abap
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](https://github.com/oblomov-dev/a2UI5_cloud_mime_fake/assets/102328295/2a30f523-9c2b-46be-89d1-516836ba7e2b)

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