Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Product and Topic Expert
Product and Topic Expert


When preparing CodeJam Events or customer presentations I ran into the one or other minor issue when developing sample OData Services using the new RESTful ABAP programming model that I would like to share with you. Most of the issues I found will be adressed the one or other way in future releases but nevertheless I wanted to share meanwhile how to get around issues.

Some findings

FETCH API (direct DB access) is not supported for entity

This error will be shown in the SAP Fiori Elements preview if you have accidently created a service binding for a service definition that exposes an abstract entity an have published the service binding as an OData service

The error details are as follows:

This is an example of an abstract entity that shows the described behavior,
/********** GENERATED on 01/24/2019 at 12:33:35 by CB0000000045**************/ 'ZC_Be2Ui_ProductReview_Ex4' 'ZC_Be2Ui_ProductReview_Ex4Type'
define root abstract entity ZZC_BE2UI_PRODUCTREV57AC70E558 {
key ReviewUUID : sysuuid_x16 ;
key Product : abap.char( 10 ) ;
Rating : abap.dec( 4, 2 ) ;
RatingText : abap.string( 0 ) ;
ReviewedBy : abap.char( 81 ) ;
RatedAt : tzntstmpl ;


OData Proxy: Execution of request "POST /sap/bc/adt/businessservices/proxies/getmapping" failed: 500 Internal Server Error

I copied and pasted a $metadata from a browser window and copied the Content into a file. Then imported it to create an OData proxy. The generation process however failed with the following error message:

Execution of request "POST /sap/bc/adt/businessservices/proxies/getmapping" for destination <SID>_EN (system failed: 500 Internal Server Error

  1. So one should not copy paste the $metadata files but should download the same.

  2. If you run into errors you can doublecheck by trying to Import the file in the Service Builder by selecting in a Service Builder project : Right click on the Folder Data Model and choose Import --> Data Model from file. The Service Builder would return the message "Invalid model file"


Preview app does not show anything on the object page

When you create a CDS view with UI annotations and use the preview functionality you have to provide @UI.facet annotation in order to show data on the object page.

If you just add @UI.identification annotations this will not be sufficient opposed to the scenario where you are using SAP Web IDE to consume the very same service.

define root custom entity ZCE_Product_via_RFC

@UI.facet: [
id: 'Product',
purpose: #STANDARD,
label: 'Product',
position: 10 }

@UI : {
lineItem : [{position: 10, importance: #HIGH}],
identification: [{position: 10}],
selectionField: [{position: 10}]
key ProductId : abap.char( 10 );
TypeCode : abap.char( 2 );
@UI : {
lineItem : [{position: 20, importance: #HIGH}],
identification: [{position: 20}],
selectionField: [{position: 20}]
Category : abap.char( 40 );