Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/oblomov-dev/mime-faker
- Owner: oblomov-dev
- License: mit
- Created: 2024-01-24T10:10:34.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-21T15:49:30.000Z (8 months ago)
- Last Synced: 2024-10-11T02:23:48.208Z (about 1 month ago)
- Topics: abap, abap2ui5, ui5
- Language: ABAP
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:
### 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.