cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fiori deployment on ABAP server.

JakubG_2024
Explorer
703

Hello all!

I have successfully deployed applications to abap server using fiori tools. Unfortunately I have some small problems, but I can't find a solution.

After deployment the application launches, but I get an error in the console that “getBindingContext” is null which is strange to me because when I launch the application locally everything works without a problem.

The second issue is the application has a problem loading

sap/ui/core/Theming and sap/base/i18n/Localization

Could this be because the SAPUI5 version on the ABAP server is old, 1.108.22 to be exact?

The third issue is that the metadata isn't loading. I don't know why because everything is working perfectly fine on local.

The partly solution for the second issue was disabling those two liblaries. When I run this app locally evertyhing is working fine. 

I'm using the newest version of https://hub.docker.com/r/sapse/abap-cloud-developer-trial.

Cheers!

Accepted Solutions (1)

Accepted Solutions (1)

JakubG_2024
Explorer
0 Kudos

Hello Noel! 

I have solved 1st and 2nd issue with changing the UI5 version in fiori tools for version what I have on the server and changing script in index.html from

 

 

<script
      id="sap-ui-bootstrap"
      src="resources/sap-ui-core.js"
></script>

 

 

to

 

 

<script
      id="sap-ui-bootstrap"
      type="text/javascript"
      src="https://ui5.sap.com/resources/sap-ui-core.js">
</script>

 

 

 with hat change all resources are loading perfectly fine!

The third issue is still unresolved 

the $metadata?sap-client=001&sap-language=PL is loagind fine with url: http://192.168.1.124:50000/sap/opu/odata/SAP/SERVICE_SRV/$metadata?sap-client=001&sap-language=PL

but the $metadata is not loading because it have wrong request url http://192.168.1.124:50000/SERVICE_SRV/$metadata and I'm getting 404 Not found error.
The correct url is http://192.168.1.124:50000/sap/opu/odata/SAP/SERVICE_SRV/$metadata. Don't know why is requesting http://192.168.1.124:50000/SERVICE_SRV/$metadata  :(. 

JakubG_2024_1-1721294068818.png

Everything is working perfectly fine when I run app locally. 

UPDATE: 

After adding to Component.ts to onInit function:

 

const oODataModel = new ODataModel(
 '/sap/opu/odata/SAP/SERVICE_SRV/');
this.setModel(oODataModel, 'odata');

 

The metadata is loading but only at first time... 

JakubG_2024_0-1721307044298.png

UPDATE2:

Finally! I found where was the problem. I had to change my formatter.ts functions from 

const model = new ODataModel('SERVICE_SRV/');

to

const model = new ODataModel('/sap/opu/odata/SAP/SERVICE_SRV/');



manifest.json:

 

 

    "dataSources": {
      "ticketService": {
        "uri": "/sap/opu/odata/SAP/SERVICE_SRV/",
        "type": "OData",
        "settings": {
          "annotations": [],
          "localUri": "localService/SERVICE_SRV/metadata.xml",
          "odataVersion": "2.0"
        }
      }
    }

 

 

ui5.yaml:

 

 

specVersion: '3.1'
metadata:
  name: com.service
type: application
server:
  customMiddleware:
    - name: fiori-tools-proxy
      afterMiddleware: compression
      configuration:
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
        backend:
          - path: /SERVICE_SRV/
            url: http://192.168.1.124:50000/sap/opu/odata/SAP
            client: '001'
          - path: /sap/opu/odata/SAP/SERVICE_SRV/
            url: http://192.168.1.124:50000
            client: '001'

 

Please leave this post for other user. Maybe it will help!
Good luck!

Noel_Hendrikx
Active Contributor
Good job!

Answers (1)

Answers (1)

Noel_Hendrikx
Active Contributor

Hi Jakub,

Let's try to split off your issues first:

1) getBindingContext error
Could you give some more information? It could be related to your metadata issue, your model might not be loaded thus failing with binding.

2) Loading Theming / localization
Might both be related to your manifest.json file which might be invalid. Can you post it here to investigate further.

3) SAPUI5 version old?
https://sapui5.hana.ondemand.com/versionoverview.html
Your version is not old, but when you use new features locally you might run into issues if you deploy it. I suggest set your UI5 version fixed to your ABAP version (index.html).

4) Metadata not loading
If your odata service is not loading, it could generate more errors afterwards. How do you initialize your model? Manifest? oDataModel? Does it give an error 404? 500?

Let's get this working for you! We need a bit more code to understand what you are doing.

Regards,

Noël