on 2024 May 10 11:49 AM
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.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
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
Best regards
Mathias.
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).
Uwe
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.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.