Going through the blog Exciting Enhacements to ESS Personal Information Profile in Enhancement pack 6 by Sagar Joshi , I came across the BAdi HRXSS_PER_SUBTYPE to control the Read Only mode. In this blog I will demonstrate the implementation of this BAdi to dynamically control the Read Only mode and to add further flexibility I will use a custom feature to determine the subtypes that are to be made Read Only.
Problem Description : Let’s say that the customer has requirement as follows :
|Employee Group||Read only mode for subtypes of Communication|
( The subtypes don’t reflect much of the real world requirement but for demo purpose, I chose these subtypes.)
The above problem can not be simply solved by checking the “Data must be displayed as read-only” in the “Determining the Active Subtypes and Make Settings” node of SPRO.
Checking the box would simply make the BLOG subtype ReadOnly for all employees.
This is where the BAdi comes to our rescue.
The solution consist of following steps:
– Creating custom Feature “ZZESS”.
– Implementing the BAdi HRXSS_PER_SUBTYPE.
Note : The use of custom feature is completely optional and one can just simply code the constarints in the BAdi implementation.I used the feature just to make sure that everytime some constraints are added/modified I don’t need to touch the implementation.And feature is something that can be easily maintained by non technical folks also.
The feature ZZESS has been created and maintained as follows :
With PME04 structure , the feature provides you control over all the Organizational Assignment aspects like personnel area,comapny code etc to dynamically set the Read Only mode.
The code snippet to show the implementation of the BAdi HRXSS_PER_SUBTYPE method MODIFY_SUBTYPES :
Now to see the changes in action , let’s first assign system username to an employee belonging to Employee Group – Regular Employee and check the Communication Infotype in Personal Profile :
As specified in the custom feature ZZESS , the Blog subtype is set to Read Only.
Now, assigning system username to employee belonging to Employee Group – Contractor and checking the Communication infotype in Personal Profile:
The Blog and Facebook subtypes are set to Read Only mode as specified in the custom feature ZZESS.
Communication Infotype in Personal Profile when the system username is assigned to Employee Group other than the above two – say Partner:
All the subtypes of Communication infotype are set to edit mode as nothing has been specified in the feature for this Employee Group.
The use of BAdi HRXSS_PER_SUBTYPE makes it real easy to dynamically control the Read Only mode and custom feature addition makes it just more flexible.