0
votes

Dear SAP Fiori Experts

Can some one please advise on the issue I am facing. I am trying to extend a Standard HCM Fiori App - My Communication Data. The requirement is to add some validations to the input filed in one of the view when save button is pressed.

Unfortunately I am unable to find the respective controller to add the validation, the view is using a HCM commons controller "hcm.fab.lib.common.controller.PersInfoWrapperController" and can some one please advise where to add the custom code in this case and even the save button is also in the “sap.ushell.ui.footerbar” ? Thank you in advance.

View:enter image description here

Project Structure:

enter image description here

2

2 Answers

1
votes

The view you are displaying in your screenshot is the “Display”-View and only contains labels and texts. So you cannot use this view for input validation. The corresponding “Edit”-View, which you might want to use is "99_Edit_Default_V001.view.xml": enter image description here

In this view, you will find the corresponding input fields.

Instead of using PersInfoWrapperController as mentioned by you, you might want to use therefore PersInfoCommonCountryController, as seen above.

This controller is found in the generic Service “HCMFAB_COMMON”, which is collectively used by all ESS apps together. The PersInfoCommonCountryController is used for “Edit”-screens in all PersInfo apps. It provides a method “validateField”, which only checks required fields but not optional fields.

All fields with attribute fieldGroupIds="PersInfoValidation" are validated. In the SAP standard these are all input fields on screens delivered by SAP. Controller-Hooks for customer specific extensions are currently not available.

One way to implement a customer specific input validation, could be to implement a customer specific “CommonCountryController” based on SAP’s generic PersInfoCommonCountryController – similar to the app-specific “CommonCountryController”: enter image description here The app-specific controller (marked with green color) needs to be replaced with your own customer specific controller.

In addition to this you need to provide your own customer-specific screen and reference there in the header under “controllerName” to your own customer-specific controller.

In order to get your customer-specific screen loaded, you need to create a customer-specific implementation of Enhancement Spot “HCMFAB_PERSINFO” in the backend – Country version would be “99”.

This implementation can inherit from class “CL_IM_HCMFAB_PERSINFO_CONFIG99”.

Method “IF_EX_HCMFAB_PERSINFO_CONFIG~GET_SCREEN_VERSIONS” needs to be redefined, to return your customer-specific screen for App ID “if_hcmfab_constants=>gc_application_id-mycommunication ('MYCOMMUNICATION')”: enter image description here

0
votes

Thank you @SAP Fiori Crew, this helped me. Sorry for the late response