ABAPFire
An ABAP client library for Firebase's Realtime Database REST API, with email-and-password authentication and methods to read, set, update, push and remove data at a path.
Talking to Firebase's Realtime Database from ABAP otherwise means calling its REST API by hand. The library wraps that API behind ABAP methods for email-and-password authentication and for reading, setting, updating, pushing and removing data at a path, and it passes through Firebase's own query parameters (shallow, orderBy, startAt, endAt, equalTo, limitToFirst, limitToLast). It authenticates only with email and password, not Firebase's other sign-in methods.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1, contributes to 1@alborghettimaintainerLars HvamContributes to this
In the atlas: maintains 13, contributes to 92, wrote 1@larshp1 contributor
Before choosing this
Signals
ActivityQuietNo published releases; repository quiet for 95 months
It publishes no releases, and its repository has been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.
What it declares
Every artifact
- Type
- Package
- Origin
- Independently maintained
As a package
- Where it runs
- does not say
- Distributed through
- abapGit
Connections
Calling an external HTTP API from application code
Download
README
quoted from alborghetti/ABAPFire under MIT, readABAPFire
ABAP Firebase REST API Helper Library
Installation
Clone it using abapGit
Install abapGit, then clone the repository in a package (e.g. $ABAPFIRE).
Install Google certificate
Install Root CA from Google Internet Authority G2 using transaction STRUST in SSL identity ANONYMOUS.
Usage
Program ZABAPFIRE_DEMO provides usage examples.
Initialize the Application
To initialize the library, just pass to it your firebase configuration:
DATA:
firebase TYPE REF TO zabapfire_cl_firebase,
ls_config TYPE zabapfire_cl_firebase=>ty_firebase_config.
ls_config-apikey = '[your apikey]'.
ls_config-authdomain = '[your authdomain]'.
ls_config-databaseurl = '[your databaseurl]'.
ls_config-messagingsenderid = '[your messagingsenderid]'.
ls_config-projectid = '[your projectid]'.
ls_config-storagebucket = '[your storagebucket]'.
firebase = zabapfire_cl_firebase=>initialize_app( ls_config ).
User Authentication
The library support only email and password authentication:
TRY.
firebase->auth->authenticate_with_email(
EXPORTING
email = p_email
password = p_pass ).
CATCH zcx_abapfire_firebase INTO lcx_firebase.
WRITE lcx_firebase->get_text( ).
ENDTRY.
Retrieve firebase data
TRY.
ls_parameters-order_by = 'carrid'.
ls_parameters-equal_to = 'AC'.
firebase->db->get(
EXPORTING
path = p_path
parameters = ls_parameters
IMPORTING
child = lt_abap ).
CATCH zcx_abapfire_firebase INTO lcx_firebase.
MESSAGE i000(zabapfire_msg) WITH lcx_firebase->get_text( )
DISPLAY LIKE 'E'.
EXIT.
ENDTRY.
If your target ABAP structure contains a column with name $KEY, firebase generated unique keys are saved in this column:
TYPES:
BEGIN OF ty_abap,
$key TYPE string.
INCLUDE STRUCTURE sflight.
TYPES:
END OF ty_abap
For data retrieving, following query parameters are supported:
- shallow: Limit the depth of the data returned. If the data at the location is a JSON primitive (string, number, or boolean) its value will simply be returned. If the data snapshot at the location is a JSON object, the values for each key will be truncated to true.
- orderBy: Set a sequence order that can be used to filter the data in combination with startAt endAt and equalTo parameters.
- startAt: Set an arbitrary starting point.
- endAt: Set an arbitrary ending point.
- equalTo: Filter on specific value.
- limitToFirst: Set a maximum number of children for which to receive data.
- limitToLast: Set a maximum number of children for which to receive data in reverse order.
Refer to official firebase documentation for more info.
Save data to firebase
Set
Writes data to firebase Database location. This will overwrite any data at this location and all child locations.
SELECT * FROM sflight
INTO CORRESPONDING FIELDS OF TABLE lt_abap.
TRY.
firebase->db->set(
EXPORTING
path = p_path
child = lt_abap ).
CATCH zcx_abapfire_firebase INTO lcx_firebase.
MESSAGE i000(zabapfire_msg) WITH lcx_firebase->get_text( )
DISPLAY LIKE 'E'.
EXIT.
ENDTRY.
Update
As opposed to the set( ) method, update( ) can be use to selectively update only the referenced properties at the current location (instead of replacing all the child properties at the current location).
TRY.
firebase->db->update(
EXPORTING
path = p_path
child = lt_abap ).
CATCH zcx_abapfire_firebase INTO lcx_firebase.
MESSAGE i000(zabapfire_msg) WITH lcx_firebase->get_text( )
DISPLAY LIKE 'E'.
EXIT.
ENDTRY.
Push
Generates a new child location using a unique key and return the generated unique key.
TRY.
LOOP AT lt_abap ASSIGNING <ls_abap>.
<ls_abap>-$key = firebase->db->push(
EXPORTING
path = p_path
child = <ls_abap> ).
ENDLOOP.
CATCH zcx_abapfire_firebase INTO lcx_firebase.
MESSAGE i000(zabapfire_msg) WITH lcx_firebase->get_text( )
DISPLAY LIKE 'E'.
EXIT.
ENDTRY.
Remove
Removes the data at this firebase Database location.
TRY.
firebase->db->remove(
EXPORTING
path = p_path ).
CATCH zcx_abapfire_firebase INTO lcx_firebase.
MESSAGE i000(zabapfire_msg) WITH lcx_firebase->get_text( )
DISPLAY LIKE 'E'.
EXIT.
ENDTRY.Others providing
Compare all 10 on the HTTP clients page →- abapify/fetch-cloudabapify/fetch-cloudA plugin for the abapify/fetch polyfill that supplies its BAdI implementation for ABAP Cloud, where cl_http_client cannot be used directly; the polyfill is installed first.independent, abapCloud-compatible plugin for the abapify Fetch API polyfill
- abapify/fetch-legacyabapify/fetch-legacyA legacy-release implementation of the Fetch API interface for outbound HTTP calls from ABAP, plugging into abapify/fetch so the calling code needs no refactoring when it moves to the cloud.independent, abapLegacy-release Fetch API implementation for outbound HTTP in ABAP
- abapify/fetchabapify/fetchA Fetch API-style polyfill for ABAP: one facade over request, response and destination, with the release-specific HTTP client of cloud or classic systems supplied by a plugin like Cloud fetch.independent, abapFetch API-style HTTP polyfill for cloud and classic ABAP
- B-Tocs ABAP SDKB-Tocs ABAP SDKAn ABAP package that carries the outbound web service call for an SAP ABAP server, with the utility and security classes it needs under it and one plugin per integration on top.independent, abapWeb service client and connector layer for calling out of ABAP
- abap-soql-queryabap-soql-queryAn ABAP report that runs Salesforce SOQL queries against standard or custom objects through a connected app, shows the rows in an ALV grid and exports them to CSV or Excel.independent, abapABAP report that runs Salesforce SOQL queries and exports results
- abap2gappsabap2gappsAn ABAP API for Google Apps integration, with a program, ZGAPPS_UPLOAD, that uploads a chosen file from the SAP system to Google Docs through a consumer registered for OAuth 2.0.independent, abapABAP API for Google Apps, with upload to Google Docs
- ABAP SDK for AzureABAP SDK for AzureABAP objects and classes for sending SAP business process data to Azure services such as Event Hub, Service Bus, Key Vault, Blob and Azure OpenAI, without depending on a middleware product.partner, abapABAP classes for calling Azure services from SAP processes
- cross-http-clientcross-http-clientAn ABAP HTTP client intended to work across classic on-premise ABAP and ABAP Cloud, using CL_HTTP_CLIENT on the one and CL_HTTP_DESTINATION_PROVIDER on the other.community org, abapHTTP client for classic on-premise ABAP and ABAP Cloud
- abap2gsheetabap2gsheetAn ABAP framework that wraps the Google Sheets API behind ABAP calls for on-premise SAP S/4HANA, authenticating through SAP's standard OAuth 2.0 client.independent, abapABAP framework wrapping the Google Sheets API for SAP S/4HANA
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:alborghetti-abapfire- JSON
- /artifacts/alborghetti-abapfire.json
- MCP
- Connecting an agent