In my earlier blog Customizing Maintain Master Data Application : HRPAO_PAOM_MASTERDATA I had written about the use of various customizing table available to manage the configurations of Maintain Master Data Application : HRPAO_PAOM_MASTERDATA to suit one's requirements.
In this blog I will extend the customizing aspect by making use of the standard Enhancement Spot HRPAO_PAOM_MASTERDATA.
Business Scenario
Let's take a scenario where the user's are supposed to have different configurations of short profile for employees belonging to different employee groups.For example
Employee Group | Short Profile Configuration |
---|---|
B - Fixed Term Employee | Standard without Telephone field |
C - Partner | Standard without Cell field |
Others | Standard |
Solution
A look at the customizing table used for Short Profile, shows that there are 4 key fields, out of which the first 3 easily makes sense.It's the fourth key field VARIABLE_KEY that will be used along with the Enhancement Spot HRPAO_PAOM_MASTERDATA to suit our requirement.
Step 1:
Create the customized configurations as required for the the various employee groups :
For the Employee Group B - Fixed Term Employees, the following configuration will be used :
(Telephone Number removed from configuration)
And for Employee Group C - Partner, the following configuration will be used :
(Cell Phone removed from configuration)
For other employee groups standard configuration will be used.
Step 2:
Now add these newly created configurations in the customizing table for short profile.The key field VARIABLE_KEY will be used this time to distinguish the configurations to be used by the master data application.
Adding these entries in customizing table alone will not serve the purpose as the standard application is not able to leverage the contents of VARIABLE_KEY.This is where the Enhancement Spot HRPAO_PAOM_MASTERDATA comes into picture. The purpose of the BAdi is to provide the value of VARIABLE_KEY while querying the customizing table to get configuration information.
Step 3:
Create implementation for the Enhancement Spot HRPAO_PAOM_MASTERDATA.
( An example class CL_HRPAO_EX_PAOM_VARIABLE_KEY has been provided.It will be better to go through this class at least once ).
Out of the two methods provided by the BAdi , the method IF_HRPAO_PAOM_VARIABLE_KEY~GET_VARIABLE_KEY will be required to fulfill the requirement.
The code snippet:
As can be seen from the code snippet that this BAdi implementation provides the variable_key ( by populating the changing parameter cv_variable_key ) which is then used to get the configurations from the customizing tables.
Result:
Short Profile in the Employee Overview Page for employees belonging to employee group:
B-Fixed Term Employee
Telephone Number is no more there in the Short Profile.
C - Partner
Cell Phone is no more there in the Short Profile.
Others
The standard configuration has been used.
Personally I find customizing Master Data Application rather easier than some of the other standard application when it comes to modifying one configuration with the other.