cancel
Showing results for 
Search instead for 
Did you mean: 

Extend Fiori TEA - Redefine GW Service: causes syntax error in DPC

Former Member
0 Kudos

Hi All,

I have been working on trying to learn how to extend SAP Fiori apps, using this documentation: http://help.sap.com/saphelp_fiori/fiori10_extend_en.pdf

Firstly I simply wanted to redefine the Gateway service for Travel Expense Approvals - Technical Service Name SRA008_SRV.

I followed these steps:

  1. Create a new service in SEGW called ZSRA008_TEA
  2. Right clicked Data Model > Redefine > OData Service (GW), and entered the details of the service, and then selected all the parts:

   3. Generated by service, giving the service name, the name ZSRA008_SRV.

At this point I got a message to say there was a sytax error in the DPC:

When I investigated what this error was I found that the error was that the DPC was inheriting from the original service data provider, which is final:

But surely, I should be allows to redefine this service? This is meant to be one of the joys of Fiori, that you can redefine the services....

But my error is so fundamental, that when I attempt to make a call to the OData service I get an instant error that there is a syntax error in the DPC.

Has anyone else come accross this?

What did you do to overcome it?

Have I made a mistake in the steps I made?

Thank you in advance!

Lindsay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lindsay,

This, like a few other "extensible" parts of Gateway has not been implemented in an extensible way.

Even if the superclass was not finalised, there are too many private methods in that class to make it worthwhile to subclass it; they won't be visible so you would have to copy them.

Your best bet, at this stage in the product lifecycle, is to copy the original DPC, modify that and assign it to your service. Not ideal but it will work until a proper and consistent enhancement strategy is introduced that allows proper re-use of components.

Regards

Ron.

Former Member
0 Kudos

Thank you Ron, it's good to know I wasn't just making a mistake/missing something key.

I like your suggestion of copying the DPC and assigning it to my service - it sounds like this is the best option we have available to us at the moment.

Thank you

Former Member
0 Kudos

I wonder how convenient it is that the DPC class for MyLeaveRequests in the documentation is not a final class (in either version 1 or 2 of that service). Did they pick this one because it would work or was it just (bad?) luck that they picked one that would work where others won't.

Obviously there are some quality checks required on this software, as it is not consistent at all. MyLeaveRequests fits the bill for redefinition, why can't the rest of Fiori.

Former Member
0 Kudos

I just did what you suggested:

I copied the DPC for the service, and then created a new service, with the same MPC (avoiding the service builder completely!) - and this works great - and more importantly this also avoids another problem I was encountering:

I had tried to create a new service and just "include" the old service, but when I was calling the service sy-uname was being changed to DDIC!

But by instead, copying the DPC and creating a new service that was I am not having these problems.

I guess the difficulty still arises when I want to change the model of this - but then I can copy the model, and make sure that my DPC references the new MPC.

Still trying things out... will let you know!

Thanks Ron,

Lindsay

Answers (1)

Answers (1)

mike_reader3
Active Participant
0 Kudos

Lindsay,

I am trying to enhance a GW service, sra010_timesheet_approval_srv, I can see the service in SICF but when I choose Redfine GW (Odata) it does not show up in the list of services to choose from?

Any thoughts?

Thanks, Mike

Former Member
0 Kudos

Hi Mike,

SICF doesn't define the service. If there is a node there, it should be in the service catalog but that isn't always 100% true

Can you see the service in /IWFND/MAINT_SERVICE, either as active or inactive? If it's there you should be able to redefine it. If it's not there, the software component needs to be installed.

FYI, the DPC/MPC of this service are not finalised, so this should be enhanceable.

Regards

Ron.