Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

 

SAP Screen Personas


 

Manipulation of flavor-role-assignments using BAdIs


SAP SCREEN PERSONAS KNOWLEDGE BASE - by Regina Sheynblat , Former Member , Kranthi Kumar Muppala

Purpose

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.

(warning) This article is based on Screen Personas 3.0 with installed Service Pack 1

Overview

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

  1. Start the BAdI Builder (transaction SE19)
  2. Select "New BAdI" in group "Create implementation" and click on button "Create Impl."
  3. Follow through the next steps to define the BAdI enhancement.
  4. 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.
  5. Double click on method /PERSONAS/IF_BADI_ROLE_ASSIGN~INIT_ROLE_ASSIGNMENTS at the right side and start with the implementation of the BAdI.
  6. The BAdI interface offers the following parameters:
    1. 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
    2. IV_APP_ID: Transaction name (in case of framework Dynpro) or Web Dynpro application id (in case of framework Web Dynpro)
    3. IT_FLAVORS_ASSIGNED_BY_ROLE: Returns the list of flavors assigned to the user based on the users roles.
    4. ET_DELETE_FLAVOR_ASSIGNMENTS: Enables you to delete flavors out of the given list (IT_FLAVORS_ASSIGNED_BY_ROLE)
    5. ET_ADD_FLAVOR_ASSIGNMENTS: Enables you to add any other flavor to the flavor users flavor assignments
    6. 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.
  7. Now you can start with your implementation of the BAdI. Let's give some simple example:
  8.  In the last step activate your implementing class and the BAdI. It is now ready to use.

 

Related SAP Notes/KBAs

 2050325 - SAP Screen Personas 3.0 : Released Notes Information