Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Monday, December 5, 2022

How to read/write/delete from/to aDSO objects

This is a sequel of my older blog that deals with classic DSO objects. This one deals with an aDSO objects. There is a set of SAP standard function modules for reading, writing and deleting data from/to the aDSO objects as well. They can easily be used in custom ABAP code in BW’s transformations.

There are function modules representing APIs for DSO objects under name space RSDRI_* (or RSDRD_*). In case of aDSO objects the API are there under name space RSDSO_*.

 

aDSO type                  Operation       Method / API

Standard                    READ                Open SQL SELECT; RSDRI_INFOPROV_READ

                                    WRITE            RSDSO_WRITE_API; RSDSO_WRITE_API_RFC

ACTIVE       RSDSO_ACTIVATE_REQ_API_RFC - Activates requests in aDSO. Multiple requests can be activated separately or whether or system can activate as many requests as possible at one shot.

                                    DETELE             N/A

Direct Update             READ                Open SQL SELECT

WRITE    RSDSO_DU_WRITE_API; RSDSO_DU_WRITE_API_RFC – Writes data from an itab into active data table of the aDSO. Each API call results in a new request. Database transaction is committed automatically.

DELETE            RSDSO_DU_DELETE_API_RFC - Deletes data from an aDSO. Whole content can be deleted or data can be deleted based on a selective deletion.

CLEANUP          RSDSO_DU_CLEANUP_API_RFC - Changes status of red requests in aDSO to green. Red requests are blocking further data loads thus have to be corrected. Only requests that were loaded via API are considered.

 

FMs ending with *RFC are supposed to be used for remote scenarios whereas other FMs are locally to be used where the aDSO and calling code resides within the same system.

 

Supporting FMs:

RSDSO_DEBUG_API – It enables a user to debug above listed RFC enabled APIs for aDSO.

 

More information:

DSO object APIs

Online docu for aDSO objects API – BW4/HANA

Online docu for aDSO objects API – BW 7.5


Sunday, July 19, 2015

Definition of BAPI

BAPI or Business Application Programming Interface is standardized programming interface that allows external access to business processes and data in SAP System. SAP defines it further object in Business Object Repository (BOR) as methods of SAP business objects or SAP interface types. The BAPIs offer an object-oriented view of business components in the SAP system. They are implemented and stored as RFC enabled function modules in the Function Builder of ABAP Workbench.

The BAPIs are here since 1996 (with R/3 release 4.5*) where the concept was introduced. Having said that BAPIs are RFC enabled function modules is not enough. There are further criteria that BAPI must fulfill. Let's have a look at them.

1. BAPI naming convention - technical name must start with BAPI_*.

2. The BAPI must implement method of an SAP Business Object (e.g. financial document, sales order, etc.)

3. The BAPI must maintain static interface through different version of SAP systems

4. It must be enabled for remote (RFC) execution.

5. It must run to completion without need for any secondary user interaction. There is no connection to SAP via SAP GUI. Therefore complete completion of data changes (if any) is required.

6. The BAPI must handle all errors by itself. If situation potentially may lead to inconsistent state of data an ABAP statement RAISE must not be used. Else it would terminate the function immediately leaving the data and the function processing in undefined state.

7. It must not cause ABAP session change. There must not be used any ABAP statement which may cause current Logical Unit of Work (LUW) within SAP User Roll Area to terminate.


According SAP all 7 criterions are adhered by SAP.  Criterions no 4 - 7 must be followed also by customer while developing custom BAPIs. Moreover only SAP objects can follow criterions 1 - 3.


In closing words I'd like to point out that BAPIs were are not designed to cover API as we traditionally know this term. Even they are very often referred as API they basically do not completely comply with the API definition. Usually SAP BAPIs are missing some of API paradigm (e.g. communication based on web protocols; abstracts consumer from the backend app; placed on wrong abstraction level; functionality is duplicated by several BAPIs doing the same; etc.). Therefore it is important that we look at the BAPI as evolution that happened in SAP while striving to enable external data access.


Useful information:
BAPI User Guide (CA-BFA)


Wednesday, October 15, 2014

SAP API Management

In today’s world Application Programming Interface (API) plays very important role. This is given by nature of every business which is nowadays – digital business. Regardless if the business is between companies and customer (in its every form like customer, employees, etc.) or between companies there always some digital part of it. The API connects digital businesses. Whether it is business process, service, platform, technology solution or content at the end it needs to be able to communicate with other of these. So they must be capable of performing data exchange between them. Here comes a role of the APIs. All parties involved in the data exchange needs to have API. By this I mean that function which do the exchange are known to all the parties and they can use them to actually perform the exchange. Moreover in today’s economy driven by mobile devices (not to mention Internet of Things (IoT) or even Internet of Everything (IoE)). Companies data (e.g. web shop data) must be available in the form of software responses to queries from other software or applications. This is so true for companies ruining their ERP systems where SAP is big player in the field.

Historically it is not one of SAP strength (e.g. see here) when it comes to the API. Over the years SAP has tried to something about it but with not much success. There were, hmm well they still are there their own solutions which tried to kind of cover role of API. To name few of them them: SAP Enterprise Services (SOA), BAPIs, IDocs. The most famous are probably sets of remote execution functions called BAPI. However in today’s world it becomes clear that SAP has to be more aggressive API when it comes to their API approach.

To solve in larger scale SAP turned to APIgee. They both recently announced a partnership. In this term SAP will delivers the API management application based on OEM’s Apigee Edge digital acceleration platform. The SAP API Management application will be available as a cloud solution on HANA Cloud Platform (HEC) and also as an on-premise solution.

The SAP API Management application provides managing of exposed functions (e.g. services available over the web) of backend systems and it has following scope:

Security – controls access to exposed services
Compatibility – support of different platform and devices that consume services
Measurability – monitoring of services


SAP API Management consists of following parts that all provide infrastructure for the API management:
API Platform - creation, security, management, consuming or basically all operations within API
Analytics Services – analytics on top of API, to see trends in its e.g. usage
Developer Services - tools to manage the community of application developers


The importance of API is very significant with SAP offerings like SAP Gateway. The Gateway provides ODATA access to SAP data. As it is currently used at very large scale within SAP customers therefore was seen a clear need for API management tool. Technically having SAP API Management on top Gateway will call on predefined Gateway services, and expose those services in the cloud. Gateway’s service catalogs will be integrated with API Management. This means out-of-the-box integration with that catalog as API proxy will be defined then catalog can be browsed and finally there is a call up of service.


Other vendors of API mngt software, basically competitors to APIgee:


More information:
2051594 - SAP API Management - Release Note