Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Naina_Shetty
Explorer
Introduction: In this blog I will describe how I was able to add F4 to a standard SAP field that was extended to a Standard FIORI App. To understand the blog you would need to have some basic knowledge of CDS views , extension to CDS views , ODATA service , In-App extensibility (Custom Fields and Logic App ).

Business Need : We are currently migrating our systems to S/4 and as LIS reports are not strategic from a S/4 point of view , decided to replace LIS report MC46 with the standard FIORI app :Slow or Non-Moving Materials FIORI App. During evaluation of the app  , one enhancement opportunity that was identified was the addition of MRP controller as a filter on the app since MC46 has MRP controller as a selection parameter. And the MRP controller field was used by the business for filtration. MRP controller was a standard field so I checked if we could use Data Source Extension option of the Custom Fields and Logic App for adding this field ,Extensibility Documentation for the app , confirmed that Data Source Extension could be used .

If you want to know how Data Source Extension works look at the blog https://blogs.sap.com/2020/04/01/adding-field-in-standard-fiori-apps-of-s-4hana-with-data-source-ext...

The issue with F4: In Customs and Fields Logic App , Data Source Extension Tab when the MRP Controller field was added , the Value Help check box was ticked , which automatically added another field Plant as well.


Value Help checked on adding the field in Custom Fields and Logic App


Now though the MRP Controller field was added to the filter , showed  the F4 symbol but on clicking on the F4 no values were shown.


MRP Controller in filters





We can see values on F4 on other  standard Filters ( e.g. Storage Location )



Analysis of the problem: In order to understand how to fix this problem first let us see what happens when we use Data Source Extension of Custom Fields and Logic App. Data Source extension in the background actually extends the Consumption CDS view(C_SlowOrNonMovingMatlQry) used by the app with the new fields( A custom extend view is automatically generated that is not editable manually ) . Since the Value Help was checked, Annotation :@Consumption.valueHelpDefinition was added and entity I_MRPController is added ( we have no option of choosing the entity, the Data Source Extension determines the entity for value help ) . So the values for F4 should come from the interface CDS view I_MRPController . Yet we do not see any values on F4



( Additional information : We have seen the way Data Source Extensions is able to add a standard field to the app is by extending the Consumption view with new fields ( provided the Consumption views has associations to the entities) . If we create a custom extend view to the consumption view without using Data Source Extensions of Custom fields and logic App we should still be able to add the standard field to the app ).


First step for analysis was to see if the backend (t-code /IWFND/ERROR_LOG) was showing any error. There was an error on the backend as seen in the screenshot below.


Checked further to see if SAP has any notes for this issue. Found the note (https://me.sap.com/notes/2841893/E) confirms that F4 help functionality is not available for Data Source Extensions and would need to be added manually but does not give a possible solution. Next checked the metadata of the service  to see what was missing . Standard filters which were showing values for F4(e.g. Storage Location) had the section in the metadata(screenshot below) which was missing for MRP Controller field




 Debugging F4 of any other working standard filters ( e.g. Storage Location)  showed that the F4 triggered method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET of CL_MMIM_SLOWORNONMOVIN_DPC class and the entity set = I_MatlDocStorageLocationVH ( storage location)



The Odata project for the App is MMIM_SLOWORNONMOVINGMATERIAL . When we look at this project in SEGW we will find that I_MRPCONTROLLER is not one of its entities



So  the Consumption view was extended with the new field and for Value help the right annotation used and CDS View I_MRPCONTROLLER provided as the value help but it is not added as an entity to the service and thus not in the metadata for the service and hence on clicking F4 , no action takes place  and hence F4 does not work . If we could add the entity I_MRPCONTROLLER to the service we can get the F4 to work . But how do we add the entity to the standard service ?


Steps for Resolution : The  blog by Andre Fischer ( https://blogs.sap.com/2021/12/08/how-to-redefine-rds-based-odata-services/ ) helped greatly in understanding how to add the entity to the standard service .

1. We will need to follow all the steps in the blog to redefine the service ,to add the CDS view I_MRPCONTROLLERVH( why not I_MRPCONTROLLER ? Explained later)  to the redefined service  , adjust  MPC_EXT ,DPC_EXT classes, add I_MRPCONTROLLERVH specific _get_entity , _get_entityset methods, add annotations.


2. Now why did we use I_MRPCONTROLLERVH instead of I_MRPCONTROLLER when the Data Source Extension had added I_MRPCONTROLLER as the entity for the value help definition  ? When trying to redefine the service and adding I_MRPCONTROLLER was causing issues as I_MRPCONTROLLER had associations to  several CDS views that were already used in the original service and those CDS views were getting added again to the service and causing issues . I_MRPCONTROLLERVH is an interface view with datacategory #VALUE_HELP and has just the required fields and would be more appropriate for the value help . But the he extended view created by Data Source Extension is not editable as it allows edit only through the Custom Fields and Logic App and we do not have a choice there to chose the value definition entity . So what could be done ?

We deleted the Data Source Extension and instead created a custom extend view for the consumption view as in the screenshot below and changed the valueHelpDefinition to I_MRPControllerVH ( In this particular case this was needed but if the Data Source extension has an appropriate entity for value help you may not need to do this )





After redefining the service and creating extend view manually , lets take a look at how the metadata looks now



And now the F4 help works as expected in the Slow or Non Moving App



6 Comments
chaouki_akir
Contributor
Thank you for the detailed explanation
Ravi1210
Explorer
0 Kudos

Hello Naina,

Thanks for the giving us insights on extending the standard Fiori app. After searching the entire blogs your post helped me a lot where I came across a similar requirement to extend Customer Purchase Order type with search help in Track Sales order which is missing.

Following the above process and  Andre Fischer's blog  I am able to create a New entity set(ZPOVH) by redefining the Odata service and extended the CDS view almost 90% steps completed

 

Ravi1210_1-1707406757869.png

. So I was stuck at the last step  like when I try to execute the standard OData service(Track Sale Order -SD_SOFA) in GW client .I get an error GET_ENTITY Set is not implemented 

Ravi1210_0-1707405742217.png

I had redefined the MPC & DPC EXT runtime service. Cleared the cache ,Meta data annotation file as well .Need your suggestions.

 

Naina_Shetty
Explorer
0 Kudos

Hello @Ravi1210 : From the error it seems some steps from Andre Fischer's blogs may not have been followed . In the DPC_EXT class ,/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET, /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY need to be redefined and  case statement for your entity,entityset needs to be added and also new methods added to the DPC_EXT class as well for the new entities. I am assuming these steps are missing

Ravi1210
Explorer
0 Kudos

Step 1:

Ravi1210_0-1707491023640.png

Step2 : /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET, /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY are already implemented with new methods as well .

Note : Initially I implemented /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET & /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY set  as I was getting the issue of Entity set not implemented on further I  redefined the other operations(Change set/Update/Delete etc ) as well from the below screenshot  even these did not help me 

Ravi1210_1-1707491184377.pngRavi1210_2-1707491219971.pngRavi1210_3-1707491264285.png

Even modified  the SADL is DPC and MPC EXT as below 

Ravi1210_4-1707491424803.png

When I execute the service of the redefined OData Srv I was able to fetch the ZPOVH values

Ravi1210_5-1707491526380.png

But if I try to execute it from standard Track sales order service(SD_SOFA)

Ravi1210_6-1707491631973.png

Upon Debugging when I run the track sales order(SD_SOFA) Service with ZPOVH entity set looks like the DPC_EXT of ZCL_ZSD_TRACKSALESEXT_DPC_EXT is not getting triggered at all and the exception is raised from CL_SD_SOFA_DPC since the entity set ZPOVH is not available in the standard DPC class 

Ravi1210_9-1707492099207.png

 

the case statements fails and at line  1194 it is calling the super class and the exception being raised like GET ENTITY set is not implemented

Ravi1210_8-1707491950984.png

Ravi1210_10-1707492145633.png

Hope this info will help you in getting some clue what I had still been missed and on top of that I had added up the annotation Models as well

Ravi1210_11-1707492344135.png

 

Naina_Shetty
Explorer

@Ravi1210 : 1. Please confirm when you redefined the service , when you saves the service ,a pop-up as below shows up , did you check Overwrite Base /Extended Service(1st Screenshot) ? This is important so that the redefined Z DPC_EXT gets called . You can confirm that by going to the service implementation of the standard service in t-code  /IWFND/MAINT_SERVICE and you will the data provider class is the Z DPC_EXT class ( 2nd Screenshot) if you had checked Overwrite Base /Extended Service

Naina_Shetty_1-1707807929434.pngNaina_Shetty_0-1707807902603.png

 

 

2. Check you have the standard service  mentioned in the iv_uuid in the methods where you modified the SADL as mention in Andre Fischer's blog 

Naina_Shetty_2-1707725191723.png

 

 

Ravi1210
Explorer

Hello Naina,

Initially I didn't check that Overwrite Base /Extended after changing that setting it worked.

Appreciate your help and for your guidance my issue solved.

 

Labels in this area