cancel
Showing results for 
Search instead for 
Did you mean: 

Unsupported OData version 4.01

Elroy
Associate
Associate
0 Kudos
959

Hi All,

 

I am currently following the learning journey as below and have been working on the Describing the ABAP RESTful Application Programming Model -> Exploring Architecture:
https://learning.sap.com/learning-journeys/acquire-core-abap-skills

I have followed the necessary steps for this, but facing the below issue after I publish the Service:
Error:
Log-dbg.js:499 2024-05-10 15:39:46.750600 [FUTURE FATAL] Failed to load component for container __container0 - Error: /sap/opu/odata4/sap/zXXXXXX_ui_flight_o4/srvd/sap/zXXXXXX_flight/0001/$metadata: Unsupported OData version 4.01
Error: /sap/opu/odata4/sap/zXXXXXX_ui_flight_o4/srvd/sap/zXXXXXX_flight/0001/$metadata: Unsupported OData version 4.01
at o.finalize (library-preload.js:2340:345)
at r.convertXMLMetadata (library-preload.js:2298:1478)
at h (library-preload.js:2304:402)

 

The steps performed were to generate the ABAP Repository objects for a table that I created.

My table definition is as follows:

@EndUserText.label : 'Flight_Modes'

@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE

@AbapCatalog.tableCategory : #TRANSPARENT

@AbapCatalog.deliveryClass : #A

@AbapCatalog.dataMaintenance : #RESTRICTED

define table zXXXXXXaflgt {

 

key client : abap.clnt not null;

key uuid : sysuuid_x16 not null;

carrier_id : /dmo/carrier_id;

connection_id : /dmo/connection_id;

airport_from_id : /dmo/airport_from_id;

city_from : /dmo/city;

country_from : land1;

airport_to_id : /dmo/airport_to_id;

city_to : /dmo/city;

country_to : land1;

price : /dmo/price;

currency_code : /dmo/currency_code;

local_created_by : abp_creation_user;

local_created_at : abp_creation_tstmpl;

local_last_changed_by : abp_locinst_lastchange_user;

local_last_changed_at : abp_locinst_lastchange_tstmpl;

last_changed_at : abp_lastchange_tstmpl;

 

}

I am trying to understand what could be the issue for this and how do I fix this.
Any help on this would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Mathias_Uhlmann
Product and Topic Expert
Product and Topic Expert

Hi,

the error is thrown by the v4.ODataModel of SAPUI5 which does not support OData version 4.01 so far. It only supports version 4.0. The typical cause for RAP to switch to 4.01 is that one of the Decimals has the scale="floating" which is caused by using the ABAP type DECFLOAT. Here, the scale="floating" may be used for the price. To be sure you will have to look at the OData metadata that are generated for your service. The solution would then be to use another numerical type than DECFLOAT.

Best regards
Mathias.

UweFetzer_se38
Active Contributor
0 Kudos

Hi Mathias,
interesting. Currently I'm facing the same error but with one of the SAP Standard Services: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata4/sap/api_salesorder/srvd_a2x/sap/salesorder/00...

Is there alraedy an UI5 version which supports V4.01?

Cheers, Uwe

Mathias_Uhlmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Uwe,

no, there is no UI5 version for that. The service URL looks as if the service is not meant for consumption on the UI but as an API.

Best regards
Mathias.

 

UweFetzer_se38
Active Contributor
0 Kudos

Hi @Mathias_Uhlmann ,

but does it make any difference? It's still OData. The exact same OData API exists also as V2 and works with SAPUI5.

Cheers, Uwe

Mathias_Uhlmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @UweFetzer_se38,

I fear it does. UI5 cannot handle scale="floating" for Edm.Decimal so far. In API use cases this seems to be less of an issue. That is your concrete issue.

But there are other things. For example, as described in Currency and Unit Customizing in OData V4 an ABAP backend will provide the unit and currency customizing to the UI. If I am not mistaken than this happens only for UI services (for OData V4 and OData V2).
Also API services might not contain all the annotations needed for the UI. Although that might be less of an issue with a freestyle application.

This does not mean that an API service could not be used on the UI at all but there are hurdles. 

Best regards
Mathias.

UweFetzer_se38
Active Contributor
0 Kudos
Thank you @Mathias_Uhlmann, yes, I'm talking about Freestyle (via Neptune Software in my case). Do you haven an idea whom to contact on your side to make an official request to implement 4.01 support? (DM me, if you don't want to answer in public)
Mathias_Uhlmann
Product and Topic Expert
Product and Topic Expert

Hi @UweFetzer_se38 ,

there are several options. As the ODataModel is part of OpenUI5, you may raise an issue in https://github.com/SAP/openui5/issues.

The alternative is influence.sap.com where SAPUI5 requests are typically raised in https://influence.sap.com/sap/ino/#/campaign/2279 and sometimes in https://influence.sap.com/sap/ino/#/campaign/2538

Please note

  • We have the requirement to support scale="floating" for Edm.Decimal internally already. This would include to accept 4.01 metadata. However, so far the priority was not sufficient to actually work on it.
  • OData 4.01 is a very broad topic, that we may never fully achieve. Similarly, we do not support everything possible with OData 4.0 so far. Specific parts of 4.01 are achievable though.

 

Best regards
Mathias.

UweFetzer_se38
Active Contributor
0 Kudos

Hi @Mathias_Uhlmann,

"influence" is a good idea, will do.

On the other hand maybe it will be enough to get rid of the "Version 4.01 not supported" even if not all functions are supported (yet). OData401.png

Uwe

Mathias_Uhlmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @UweFetzer_se38 ,

we will need to allow 4.01 metadata already for supporting scale="floating". We will not be able to support all 4.01 features at that time.

Best regards
Mathias.

Answers (0)