Downtime Announcement: Please note that SAP Community Wiki will be unavailable due to a system upgrade on Tuesday, August 11th between 7 and 11 AM CEST
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 Tamas Hoznek , Regina Sheynblat , Dominik Ofenloch

Purpose

This article explains how can you 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.

Overview

SAP Screen Personas Administrators can use the Personas Admin tools to assign flavors to users:

In some scenarios the role assignment doesn't fit to the requirements. For example you may want 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 criteria, 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:

BAdI is based on interface /PERSONAS/IF_BADI_ROLE_ASSIGN. To implement it please follow these 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. Now 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 method /PERSONAS/IF_BADI_ROLE_ASSIGN~INIT_ROLE_ASSIGNMENTS in the right pane 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 user's roles
    4. ET_DELETE_FLAVOR_ASSIGNMENTS: Enables you to delete flavors from the given list (IT_FLAVORS_ASSIGNED_BY_ROLE)
    5. ET_ADD_FLAVOR_ASSIGNMENTS: Enables you to add any other flavor to the user's flavor assignments
    6. EV_DEFAULT_FLAVOR_BY_ROLE: Enables you to set 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 look at a simple example:
  8. Finally, activate your implementing class and the BAdI. It is now ready to use.