The series E2E: BOPF-SADL-GW-SAPUI5 describes how to create an SAP Gateway service based on the Business Object Processing Framework (BOPF) by leveraging the mapping features of the Service Adaptation Description Language (SADL). We are glad to receive feedback and questions about this technology.
With this article I explain the most important limitations of this approach. I will also explain where these limitations come from, so you may have a better idea of what you can expect (not) to work in general. I assume that you already had a look at the “Map to Data Source” feature of the SAP NetWeaver Gateway Service Builder as described in E2E: BOPF-SADL-GW-SAPUI5 - Mapping an Entity Set.
SADL started out with the ambition to remove all “heavy” framework overhead for read-only scenarios. By doing so, SADL is an ultra-fast query engine which makes it possible to access and interactively page through millions of records with very short round-trip times. For instance, SADL provides the run time engine behind ALV and FPM on SAP HANA.
SADL uses BOPF’s metadata information to bypass the BOPF runtime for read-only scenarios. This is only possible if there is a static mapping between the structures used by the BOPF service manager API and the underlying database.
Today, SADL is no longer limited to read-only use cases, but it also offers support for modifying operations. SADL does not try to directly update data on the database, but delegates any modifying request to BOPF. This ensures the consistency of business data.
Although SADL supports modifying operations by delegation, it is important to keep in mind that the full use of SADL is generally limited to scenarios where it is possible to establish a static mapping of business object data to the database.
So, what are the prerequisites for SADL to be able to map BOPF data directly to the database?
The node’s database table must be maintained. Transient nodes in particular cannot be mapped.
If you need to expose a BOPF node which cannot be mapped by SADL, you will have to manually implement this in your service’s data provider class (DPC).
If you need to expose transient attributes you have to leave them unmapped. In addition, you have to redefine the entity set-specific implementation in your DPC. You can, for example, first call super (SADL’s generic implementation) and afterwards fill the missing values for the transient attributes. Take care not to flag such attributes as “sortable” or “filterable” in the property definition of the entity type.
If you need to map an association which cannot be handled by SADL, you will have to manually implement this in your DPC.
SADL translates all authority checks into the WHERE-condition of a generated SELECT statement. This is a necessary precondition for efficiently processing requests for arbitrary pages of a given result set. Therefore, it must be possible to derive a WHERE-condition from BOPF’s metadata. This means:
While SADL is being heavily used within new SAP applications, there are still scenarios which have not received much attention, so far.
There is a natural conflict between some BOPF BOs which have been optimized for traditional SAPGUI or WebDynpro applications on the one hand, and modern web-based applications using stateless services on the other hand. Some framework optimizations which have been introduced for traditional applications can turn into a bourdon for modern architectures.
In a stateless context, you would like to post only small updates with each service call. You might want to “activate” your object only after a series of modifications which would not make much sense each on their own. You would like to be able to save an incomplete version (“draft”) of your document and continue working on it later – knowing that the existence of your draft prevents the original document from being modified in the background.
On the other hand, a classic BOPF BO – if it has been developed with only session-based applications in mind – may refuse to save any business data as long as it is not in a “consistent state”. Inconsistencies are only temporarily allowed within the current ABAP session. For the time of the current session, BOPF locks instances against parallel changes.
A stateless service request is answered by an ABAP session. The next request creates a new session. Any locks acquired in the first session are lost as soon as it ends. In addition, some updates may fail because of save-preventing BOPF validations.
The cheap answer to this problem is: Only use a BOPF BO in a stateless service after you have verified that it is suitable for the scenarios you are targeting. Especially BOs with strict consistency checks or save-preventing validations are likely to cause issues.
However, at SAP we are working on a better solution to bridge the gap between classic applications and the world of stateless UIs. Stay tuned!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
2 |