cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Fiori Application: Odata extension

Former Member
0 Kudos

Hi There,

I am trying to extend Timesheet application using Odata extensions to hook some validations around start/end time/duration fields.

Now to begin i wanted to ensure a custom Odata services can be actually called from my Fiori application. So steps i followed

1) Create a new project in SEGW and select Redefine Odata, selected SRA002_TIMESHEET and created

2) Since wanted to see this working... i DID NOT implement any method.. I generates the project and registered in system. All successfully generated and registered

Question: Do we HAVE to implement at least one method for OData extension to work?

3) Create a Fiori extension project on Eclipse and on assign custom Odata.  This is again skeleton project and i just changed a label to see this working.

Question: Master Collection should be the same as Standard Application MasterCollection.. or we need to use a new one?

4) I create required Fiori launchpad entries to add to user launchpad. and i can launch application. But... the it does not like the OData change.

5) Error Logs: does not releave much.. apart from the fact that .. request Url seems to be all over..

Any help will be appreciated !!

Thanks a lot.

Regards,

Sudhir

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Sudhir,

In the GW level,

Once you redefine the standard service and select all the necessary model related things by creating a new project ( entities , associations & navigation etc ... ) , now you can do changes to the new model of the new project as per your needs and generate the run time artifacts.

Now go the newly create DPC_EXT class, redefine the necessary methods as per your needs and add your custom logic, activate the class.

In /IWFND/MAINT_SERVICE add the newly created service by selecting the appropriate system alias name and save.

Click on GW Client button and test the newly created functionality.

For more info ->

https://help.sap.com/saphelp_fiori/fiori10_extend_en.pdf

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20dbf542-f3e7-3110-a6b8-ebb96b57c...

Regards,

Ashwin

Former Member
0 Kudos

Thanks Ashwin,

That was very useful to start with. As i mentioned, I already managed to travel few steps and both extension project and Odata is created. Since i only wanted to test these in concept. I have not implemented any methods. Would you say, i have to implement at least one method?

Regards,

Sudhir

AshwinDutt
Active Contributor
0 Kudos

Hello Sudhir,

Implement only if you want to add some lines of code to the standard code so that your new validations will work.

Just to test no need to implement.The standard code would already been there.

You can quickly test the service in GW Client with correct URL and see if you are able to get data. Confirm this and then you can add the custom code by implementing methods in DPC_EXT class.

Regards,

Ashwin

Answers (2)

Answers (2)

AshwinDutt
Active Contributor
0 Kudos

Hello Sudhir,

Quickly debug and check the URL formed at the run time in the application.

From this you can correct the URL.

Check if any BATCH operations are being done i.e., check the payload.

The mentioned error usually comes when your are sending filter parameters wrongly inside your payload.

Inside payload URI Convention for filter is as below :

GET get_emp_dataSet?$filter=Userid+eq+'00001'+and+Name+eq+'ASH*' HTTP/1.1

Kindly check the above points.

Regards,

Ashwin

Former Member
0 Kudos

Thanks Ashwin,

Not sure if this is workaround or bug. When i implemented GetEntitySet and GetEntity methods(copied from standard code), it starts to work like nothing has happened.

That was always a concern but can someone verify that one HAVE to implement one of these getEntity methods in order to get Custom gateway service(Odata redefine scenario) working?

Regards,

Sudhir

AshwinDutt
Active Contributor
0 Kudos

Hello Sudhir,

I quickly tried replicating your scenario.

I wanted to filter data based on some input. I directly fired the URL but got an error saying GET_XXX_GET_ENTITYSET is not implemented.

I redefined the GET_XXX_GET_ENTITYSET in my newly created DPC_EXT class and wrote my logic to filter the data. After that it started working.

I was also ended up doing the same as you did.

Initially i had thought we need not to implement but looks like we need to redefine and implement the respective methods for our CRUD operations to work.

Regards,

Ashwin

kammaje_cis
Active Contributor
0 Kudos

Sudhir,

You have not selected all entities from the original service(I see that you selected only one). The Fiori app is looking for entity "TimeData", which it could not find in the new service, so the error.

Thanks

Krishna

Former Member
0 Kudos

Hi Krishna.

I did create one with all entities. . and Model reference is one to standard one.

After running this application. and the previous error is gone, though.. "Invalid type for '$filter' system query option." appearing now.
trying to make sense of logs.. but since i did not change anything after redefining, not sure what might have changed