Our customer (on EHP minus 1) decided on a multi country implementation of MSS Add-on 1.0 with the requirement that all fields in ESS should have visibility control based on attributes of employee like Company Code, PA/PSA or EG/ESG.
The standard approach would be to use define multiple screens with required fields, use HRESS_C_PERSINFO_CONFIG to replace per combination and implement BAdI HRESS_PER_CONFIG_KEY for additional attributes. This definitely meets the requirement, however has following maintenance issues from a customer perspective.
- Introduction of new field in future will have to be added to multiple screens pre-defined across all countries.
- Any changes to screen for a specific combination defined by business will have wait till the monthly release cycle to be reflected in the portal ( only emergency transports can be moved to production environment between cycles)
- Most importantly, all changes require support organization involvement (configuration/transport). This should be avoided and had to be maintained by a power user directly in production using a custom table
Approach: Field visibility should be controlled both in Overview Screens and Detailed Screen. We will hide Date of Birth (GBDAT) in Personal Data in the blog.
CL_HRESS_PER_OVERVIEW is the default class used in these UIBBs. We need to enhance 2 methods to achieve the requirement.
Modify ET_FIELD_DESCRIPTION for GBDAT and Set VISIBILITY as 01.
Store value of VISIBILITY_REF. Export to memory for later use.
Now enhance Methods: IF_FPM_GUIBB_LIST~GET_DATA
Clear value of component (FPM_BOL_GUIBB_REF_XXXXXXXXXXX) stored for reference field VISIBILITY_REF to initial.
Now, the field GBDAT is hidden in Overview Screen
CL_HRESS_PER_DETAIL is the default class used. We need to enhance 2 methods to achieve the requirement.
In method, IF_FPM_GUIBB_FORM~GET_DEFINITION, for ET_FIELD_DESCRIPTION change visibility of GBDAT to 01 from VISIBILITY
In method, IF_FPM_GUIBB_FORM~GET_DATA, modify CT_FIELD_USAGE. Change VISIBILITY to 01 for and FIXED_VALUES to X for GBDAT.
GBDAT is hidden in detailed screen also.
This approach can be used for standard overview/detailed screens. A custom table can be configured calling the Config IDs and visibility set based on the attributes as required.
Special Thanks to Sonu Krishna