SAP Screen Personas
Create: Former Member Jul 20, 2015 14:15
Last Update: Regina Sheynblat Feb 06, 2019 22:26
Manipulation of flavor-role-assignments using BAdIs
SAP SCREEN PERSONAS KNOWLEDGE BASE - by Regina Sheynblat , Former Member , Kranthi Kumar Muppala
This article explains you how you can manipulate the assignments of flavors assigned by role using SAP BAdIs. This enables developers to implement company-specific rules for flavor assignment and setting up default flavors.
This article is based on Screen Personas 3.0 with installed Service Pack 1
SAP Screen Personas Administrators can use the Personas Admin tools to assign flavors to users:
- A flavor can be assigned to any user directly. For this you can use transaction /PERSONAS/FLAVORS. Using transaction /PERSONAS/USERS additionally enables administrators to set up the default flavor for any user.
- A flavor can be assign to a group of users by role. For this you have to enable the chosen PFCG role for personas using admin transaction /PERSONAS/ROLES. Afterwards you can use the same transaction to assign the flavor to the usergroup having the specified role. Additionally you can also set up the chosen flavor as default flavor for the users.
In some scenarios the role assignment doesn't fit to the requirements. For example in case you like to set-up different default flavors to your call center agents based on their default sales organization. To realize flavor assignments and default flavors on your own selection criterias you can use BAdI /PERSONAS/INIT_ROLE_ASSIGNMENT.
Implementation of BAdI /PERSONAS/INIT_ROLE_ASSIGNMENT
BAdI /PERSONAS/INIT_ROLE_ASSIGNMENT enables the manipulation of the flavor role assignments. Here you have 3 options:
- You can delete assigned flavors
- You can add any other flavor which is released for the same framework and application id (transaction in case of framework "Dynpro").
- You can set up the default flavor
BAdI is based on interface /PERSONAS/IF_BADI_ROLE_ASSIGN. To implement it please follow the next steps
- Start the BAdI Builder (transaction SE19)
- Select "New BAdI" in group "Create implementation" and click on button "Create Impl."
- Follow through the next steps to define the BAdI enhancement.
- Finally you're in screen "Enhancement Implementation". On this screen select tab "Enh. Implementation Elements" and double click on the Implementing Class in the "BAdI Implementations" tree.
- Double click on method /PERSONAS/IF_BADI_ROLE_ASSIGN~INIT_ROLE_ASSIGNMENTS at the right side and start with the implementation of the BAdI.
- The BAdI interface offers the following parameters:
- IV_FRAMEWORK: Can be "01" for Dynpros or "02" for Web Dynpros. Please use the constants GC_FRAMEWORK_DYNPRO offered by interface /PERSONAS/IF_CONSTANTS
- IV_APP_ID: Transaction name (in case of framework Dynpro) or Web Dynpro application id (in case of framework Web Dynpro)
- IT_FLAVORS_ASSIGNED_BY_ROLE: Returns the list of flavors assigned to the user based on the users roles.
- ET_DELETE_FLAVOR_ASSIGNMENTS: Enables you to delete flavors out of the given list (IT_FLAVORS_ASSIGNED_BY_ROLE)
- ET_ADD_FLAVOR_ASSIGNMENTS: Enables you to add any other flavor to the flavor users flavor assignments
- EV_DEFAULT_FLAVOR_BY_ROLE: Enables you to set up a new default flavor. This flavor must be already part of the list of IT_FLAVORS_ASSIGNED_BY_ROLE or it must be added to the exporting parameter ET_ADD_FLAVOR_ASSIGNMENTS first.
- Now you can start with your implementation of the BAdI. Let's give some simple example:
- In the last step activate your implementing class and the BAdI. It is now ready to use.
2050325 - SAP Screen Personas 3.0 : Released Notes Information