cancel
Showing results for 
Search instead for 
Did you mean: 

Extend Gateway layer of SAP Fiori Standard App

fenil_doshi
Participant
0 Kudos

Hi Experts,

I just started extending the fiori standard apps and have referred the standard documentation available for that but as we know that few of the apps are available in service builder application but few of the apps like Leave approval are build using the traditional way using SE80 and everything is developed there (including classes and all) so in my scenario I have already added the fields as described in the documentation of Leave Request Approval standard Fiori Application (link) and as per that documentation have added fields to that structure /GBHCM/LRA_LREQ_INCL and have utilized in class /GBHCM/CL_MANAGER_APPR_RDP2 but how do I modify the gateway entity LEAVEAPPROVAL as I am not using segw and thats why I am not able to get the same fileds in the front end. How do we modify the Design Time: Gateway Entity : LEAVEAPPROVAL so that fields are available in the front end for consumption.



Regards,

Fenil.

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

If its developed through SE80 you can find the MPC and DPC as follows :

Go to /iwfnd/maint_service -> select the service -> click on Service Implementation button.

This will navigate to the screen where you will se the MPC and DPC Class details and then you can go ahead and modify as per your needs.

Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

Thank you for the reply.

I had checked those MPC classes there we need to define additional fields which are being utilized in the Services and DPC I have already extended just need to declare same fields in the MPC classes so that same model gets binded during runtime in the frontend and are available for the consumption.

Please suggest for the same.

Regards,

Fenil.

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

1. First find the Structure which is bound to the Entity LEAVEAPPROVAL.


Inside Define Method of MPC Class You will see the below line of code.

Example ->

lo_object->bind_structure( '/IWBEP/CL_MGW_RT_SFLIGHT=>TY_S_SFLIGHT' ).


2. Now go inside that Structure and Add the Field there.

3. In the MPC Class go inside DEFINE Method and add the property.


lo_property = lo_object->create_property( iv_property_name = '<Give Your New Property Name>'

                                                    iv_abap_fieldname = '<Filed Name which is newly Added by You in the Structure which is bound to the Entity LEAVEAPPROVAL>' ).


Save and Activate.


4. Clear Model Cache with T-Code /iwfnd/cache_cleanup


Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

Thank for your prompt response will check this right away and revert to you. As service project hasn't been developed by us it is shipped by SAP Itself for all the standard Fiori Applications and if we want to extend it then we have various extension points for that but as all of the services aren't developed using Service Builder tool (segw) some of them are developed using traditional method prior to release of the Service builder tool. I have taken below image as reference will revert back once I implement the soution as per your reply and will give you the feedback regarding the same.

Regards,

Fenil.

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

Coming to modifying a Standard SAP Service,

Its not a good idea to modify the Standard Service shipped by SAP.

I would suggest to copy Standard MPC and DPC classes into a new classes, then add fields in New MPC and implement custom logic in New DPC class accordingly.

Now in SPRO, Maintain Models & Services with a New Name and a New Version.

Register in GW System and assign Correct System Alias and Consume it.

This way you can keep Standard Service untouched and can keep both Standard Service and Modified Service Active.

Now in /iwfnd/maint_service, you will see 2 Services. One is the Standard Service and One is the newly created Service with a New Version.

Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

Actually SAP has only provided that extension points for all the Fiori Apps and as standard Apps utilize the standard services and so I am extending them them as per the requirement and so that I can extend standard Fiori app. My main issue was that as per the SAP Documentation I have already extended the structure and have added the fields in that structure and also implemented the data provider code for it but the problem is that as I have not changed the model provider class for that particular extension that fields don't show up in the xml document when I append metadata to that particular service.

Regards,

Fenil.

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

You need to modify MPC class and then you will be able to see the fields in the GW Service Response.

Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

I enhanced the model provider class for that particular service and that specific method and then all the fields were available in the service response in the gateway client. I am closing this thread marking your answer as correct.

Thank you for your support.

Regards,

Fenil.

Answers (0)