Skip to Content

Register XSOdata servies into SAP Gateway

Complete procedure for registering xsodata services which are developed in HANA to SAP Gateway.

For any requirement in which if we develop xsodata services and use it while creating UI5 application in web ide, We can directly take that xsodata service URL from WEB ide or we can also register the service into SAP gateway and select the specific URL as a odata service URL to avoid issues while deploying app to SAP UI5 repository.

there are two ways for registering xsodata services.

  1. Using transaction code /n/iwbep/oci_srv_gen
  2. Using transaction code SEGW)

-> Create SM59 RFC connection between SAP Gateway system and HANA db, Connection should be HTTP Connection to external server (Connection Type “G”).

Provide Host and port name.

Path prefix should be “/”

Provide logon details under logon & security tab.

after creating click on connection test, it should be successful. 

 

-> Create system Alias

Click on create system alias, provide below information.

Enable both local gateway and for local app to avoid any further issue while registering services.

-> Navigate to transaction /n/iwbep/oci_srv_gen

Provide below information.

Service namespace – XS Project name in HANA DB

service name – xs odata service name

Provide package and transport request details before execute itself otherwise dpc, mpc willnot be stored in TR

Click on execute

Gateway services are created ,now we need to activate and register the service.

-> Navigate to transaction    /n/IWFND/MAINT_SERVICE

Click on add service, Provide system created alias name and technical service name which we have created above and click on get services.

Now click on ZTEST_SRV and activate it (Click OK).

 

Go back and select the service , click on SAP Gateway Client and test the service.

You can also test the service by selecting Entitysets. If any mismatch in the datatypes while registering in sap system, it will show an error from that entity set.

 

2) Using Transaction Code SEGW

Create SEGW Project

 

-> Redefine odata service

Provide below details

Service namespace – XS project name in hana db

Service Name – XS Odata service name

Click on next

Select required entity sets and click on finish

Select the project and click on Generate run time objects

You can see the below screen after run time objects generated

Now the service (ZTEST_SRV_01) is created and we can activate it from transaction “/n/iwfnd/maint_service” as mentioned previously in step1 procedure.

Here we can also debug entire process of connecting to HANA DB and fetching the data into SAP Gateway.

To conclude, If we want to retrieve data from any other third party and display it in Fiori App, we can use the above procedure for registering the entire service data(which is developed in HANA) into SAP Gateway and there by we can use the same service in developing UI5 application.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7 Comments
You must be Logged on to comment or reply to a post.
  • Hi Thanks for this helpful post. We have added XSOdata through both methods mentioned here – but we are facing an issue where the registered service is not working properly once added to gateway.

    It registers with no errors, but the data does not retain the same data structure or response to URL query like it does on HANA service.

    For example: ‘$show=Plant,Status,Count’ should return each plant with number of count per status – but it gives a line item for each single count and does not group them any longer.

    Do you know why this would happen? I have tried adding the service multiple times with this same issue repeating each time. Is it something needed to be changed in original XSOdata?

    Any advice is greatly appreciated, thanks

    • Hi Justin,

       

      There are chances of xsodata service fail due to change in datatypes. Few datatypes which may not support in SAP when you register from HANA. Please cross check for the datatype of all fields. Hope this may help you.

       

      Thanks,

      Divi

  • Hi All,

    I have created xsodata in hana and trying to Register XSOdata services into SAP Gateway using above blog. I have created RFC connection as mentioned above.

    But while testing I am getting “Connection closed” message.

    Can you please suggest if any prior configuration required or what can be possible error.

    • Hi Avinash,

      Have you mentioned the path prefix? and please check for the correct host and port details. I didn’t perform any additional prior configurations for creating RFC Connection.

      Thanks,

      Divi

      • Thanks  Srilaxmi for reply.

        Path prefix given as  ‘ / ‘ which you have mentioned in Blog.

        Regarding Port details I have used 4300 which is for HTTPS xsodata for this I am getting  “Connection closed” message.

        But If I will used 8000 port which is for HTTP port that time I am getting Status as 200 means RFC is generating.

        My XSODATA  has port 4300 and for this I am facing issue.

        Is there any other configuration required for HTTPS based XSODATA?

  • Great Blog !

    I have one question…If the HANA XSodata is Changed by adding one more entity it is not getting reflected in SAP gateway service.

    How do I refresh the gateway service?

    Thanks in advance!!

    • Hey Anand!

      Try Reactivating from tcode – /n/iwbep/oci_srv_gen

      It won’t be automatically refreshed in gateway untill we regenerate.