Header Ads

Account Classification


Define Account Classification

Use
Using classification categories, you can flexibly combine classification criteria and attributes, as you require. For example, a company could be a customer in the business unit "Automation" but a competitor in the business unit "Mobile Phones".
In this activity, you define the classification categories, criteria, and attributes you require.
Classification Categories
One classification category is delivered for accounts, with a number of predefined criteria. However, you will generally define your own classification categories:
  • You are allowed a maximum of five criteria per category. The assignment of criteria to category can be changed provided no data has been created yet for the account classification.
  • You can add an unlimited number of your own or predefined attributes to a category.
Criteria and Attributes
When defining criteria and attributes you specify the following:
  • Handler Class
    The handler class is used to determine the value ranges for criteria and attributes. It is called whenever values are required on the UI or validated.
    Using handler classes also allows you to implement your own logic for overriding values returned for standard attributes and criteria.
    The handler class inherits the methods from the superclass CL_CRM_BUPA_CLASS_HANDLER (delivery class G of table CRMC_BP_CLATTR, therefore protected against SAP updates).
    The following methods have to be redefined for your handler class to derive the value help correctly:
  • IF_CRM_BUPA_CLASS_HANDLER~GET_DDLB_VALUES
  • IF_CRM_BUPA_CLASS_HANDLER~GET_VH_DESCRIPTION
  • Domain
    For attributes, you can also assign a domain with an attached value table. The handler class evaluates the domain values or attached value table and passes these, if available, to the implementation for further processing. If neither a domain nor handler class is assigned, however, values can be entered on the UI without a value help, in the form of a free text.
  • Single-Value
    An attribute can be single-value or multi-value. For example, an account can have different roles for the same combination of critieria with identical values, but only one rating.

Default Settings
A basic set of criteria and attributes are provided as standard for the classification category ACCOUNT. If these do not meet your business requirements, you have two options:
  • Enhance the standard with your own criteria and attributes
  • Create your own classification category with the necessary criteria and attributes
Activities

Scenario 1: Assigning Your Own Attributes to the Standard Classification Category ACCOUNT

If you want to enhance the standard category ACCOUNT with your own attributes, you can define the new attributes in this Customizing activity and assign them to standard category ACCOUNT.
You define the relevant value ranges for these attributes according to the steps described for scenario 2.

Scenario 2: Creating Your Own Classification Category

To introduce a new classification category, consisting of your own combination of criteria (this can also include standard criteria such as "sales organization# or "country#) and a range of attributes, perform the following steps:
    1. In the customer namespace, create a handler class which provides value ranges and value help types for custom criteria and attributes.
    2. Define a classification category, criteria, and attributes, and assign the criteria and attributes to the new category (step 1 is a prerequisite for assigning the handler class to new criteria and attributes).
    3. Create a new configuration for the custom classification category.
    4. Generate and adjust the runtime repository for UI maintenance of the new category using an enhancement set.
    5. Add new assignment block to account overview page.
    6. Create a new configuration to enable a search by the criteria, attributes and values associated with the new category.
    7. Enhance the search structure with the search term for the new category.
    8. Implement the methods GET_DDLB_VALUES and GET_VH_DESCRIPTION of the handler class to provide values and value help types.
1. Creating a Handler Class
For each criterion, you need to enter a handler class which inherits the interface methods IF_CRM_BUPA_CLASS_HANDLER~GET_DDLB_VALUES and IF_CRM_BUPA_CLASS_HANDLER~ GET_VH_DESCRIPTION. This handler class must be a subclass of either class CL_CRM_BUPA_CLASS_HANDLER or CL_CRM_BUPA_CLASSIFICATION. By entering one of these classes as the superclass, the above interface is passed down to the subclass.
You can create different handler classes, which can be assigned to different criteria and attributes, depending on your business requirements:
  • Enter class CL_CRM_BUPA_CLASSIFICATION as the superclass for your handler class if you want to use a standard criterion or attribute and override the values returned by the standard.
  • Enter class CL_CRM_BUPA_CLASS_HANDLER as the superclass for your handler class if you want to create your own criteria or attributes and define the value range and value help type according to your requirements (standard criteria and attributes are not sufficient).
    Note
    If you intend to use values associated with a domain (fixed values, attached value table) for an attribute, you do not have to use a handler class. The values will be retrieved automatically from the domain assigned to the attribute in Customizing.
2. Defining a Classification Category, Criteria, and Attributes
Prerequisite: Step 1 to be able to assign the handler class to new criteria and attributes
    1. In this Customizing activity, create a new classification category and enter a description (leave fields Search Structure and Field Name blank). Save the changes.
    2. Create new criteria and enter the name of the class you created in the field Handler Class. Each criterion can be assigned a different handler class. The handler class specified can also be assigned to an attribute (see next step).
    3. Create new attributes. You can enter the name of a handler class (which can also be assigned to a criterion), the name of a domain, or none of these.
    If you specify a domain, make sure that there is either a value table associated with this domain or fixed values defined for the domain. Otherwise no values can be returned for the attribute.
    If a handler class is entered in addition to a domain, the values are retrieved from the domain during runtime and subsequently passed to the handler class. A filtering of these values can be done in the implementation of the method GET_DDLB_VALUES. (Where filtering is not required and there is therefore no logic implemented, the values provided to the method GET_DDLB_VALUES are merely passed on for further processing).
    If you enter a handler class only, the implementation of method GET_DDLB_VALUES returns the values associated with the attribute.
    If neither a handler class nor a domain is specified, the values entered for this attribute are regarded as free text. This means that values entered for this attribute will not be validated.
    Define whether the attribute is single-value or multi-value.
    4. Choose Categories in the view cluster structure and select the classification category you created. Choose Category -> Criteria.You define the number and combination of criteria that apply to the new classification category. A maximum of five different criteria can be assigned to the category in the fields Citerion 1 to Criterion 5.
    Note
  • A value has to be entered for the first criterion.
  • Criteria have to be entered consecutively, starting with the first criterion and without any gaps.
  • A subsequent change to a criterion, associated with a position (changing the assigned criterion, deleting the last criterion), can only be made if no values exist in the application table CRMM_BUT_CLASS for the relevant criterion, which is identified by its position.
  • All available criteria can be assigned to the category, including standard criteria.
    5. Choose Categories in the view cluster structure and select the classification category you have created. Choose Category -> Attributes and add the attributes you want to include in the selected classification category. You can also add standard attributes.
    6. Save your changes.
3. Creating a New Configuration for the Classification Category
    1. Execute transaction BSP_WD_CMPWB for the component BP_CLASS, and select the view BP_CLASS/AccountClassificationOV with a double-click.
    2. Go to the tab Configuration and switch to edit mode for the default configuration.
    3. Choose Copy Configuration and confirm the prompt.
    A configuration attributes dialog box appears.
    4. Select the values:
    Object Type = BP_ACCOUNT
    Object Subtype = <new classification category key> (as defined in step 2)
    Choose Enter.
    5. Adjust the configuration appropriately (rename and configure the categories as defined in step 2). To do this, delete unused fields and add text fields as required (depending on the type of value help). No text fields are required for DDLB.
    6. Save the configuration.
    7. Repeat these steps for the view BP_CLASS/AccountClassificationEL.
4. Generating and Adjusting the Runtime Repository
    1. Start transaction SE38.
    2. Enter one of the following programs and choose Execute:
  • CRM_BUPA_UI_CREATE_CLASS_EOVP (if you are using the editable overview page)
  • CRM_BUPA_UI_CREATE_CLASS (if you have set the user parameter CRM_UIU_OLD_UIC)
    3. Select the enhancement set for which you want to make the new classification category available.
    As enhancement sets are client-dependent, check which enhancement set is active in the client in which you want to make the new classification category available. To do this, check the view BSPWDV_EHSET_ASG in transaction SM30.
    4. Select the new classification category and run the report.
5. Adding a New Assignment Block to the Account Overview Page
    1. Execute transaction BSP_WD_CMPWB for the component BP_HEAD and the enhancement set you selected in step 3, and select the view BP_HEAD/BPHEADOverview with a double-click.
    2. Go to the tab Configuration and switch to edit mode for the default configuration (or the configuration for which you want to make the new classification category available).
    3. Select the new assignment block from the list of Available Assignment Blocks and move it to the list of Displayed Assignment Blocks.
    Choose Show Technical Details to see your classification category ID as a view ID.
    4. In the list of Displayed Assignment Blocks, enter the description of the assignment block you have just added and other settings such as load option, etc.).
    The description specified for the classification category in Customizing is not copied across here.
    5. Save your changes.
6. Creating a New Configuration for the Search
Repeat the steps performed in step 3 for the view BP_CLASS/AccountClassificationSearch in  the component BP_CLASS (transaction BSP_WD_CMPWB):
    1. Copy the default configuration, and enter the object type BP_ACCOUNT and select the ID of the new classification category for the object subtype.
    2. Add all relevant criteria to the configuration and change the field labels accordingly. Remove any unused criteria from the configuration. Leave the fields Attribute and Value unchanged.
    3. Save your changes.
The type of value help for each field is determined at runtime in the implementation of the method GET_VH_DESCRIPTION of the handler class associated with the corresponding field.
7. Enhancing the Search Structure
A separate component must be available in the search structure CRMT_BUPA_IL_HEADER_SEARCH for every classification category:
    1. Enhance the structure CRMT_BUPA_IL_HEADER_SEARCH with a new component in the customer namespace using an existing append. If a customer append does not yet exist, create one and add the new component.
    2. Add the new search parameter to the account search in the transaction BSP_WD_CMPWB for the component BP_HEAD_SEARCH. Select the view BP_HEAD_SEARCH/MainSearch and add the new search parameter to the configuration. Enter an appropriate name, ideally the description of the classification category.
    3. Enter the name of the search structure CRMT_BUPA_IL_HEADER_SEARCH and the field name you added to this structure in step 1 in the definition of the new classification category in the view cluster CRMVC_BUPA_CLASS.
    4. Save your changes.
8. Implementing Methods for Deriving Value Helps
Implement the methods GET_DDLB_VALUES and GET_VH_DESCRIPTION of the handler class to provide values and value help types.
  • Method GET_DDLB_VALUES
    The values maintained for criteria and attributes are retrieved from an implementation of the method GET_DDLB_VALUES, which needs to be redefined in the handler class you have assigned to the criterion or attribute.
    The method is called at runtime every time values are requested when creating classification data for an account using a dropdown list box. It is also called when the entered values are validated within BOL and and to provide value ranges in the account search (also see the note at the end of this section).
    There is basically no difference in the way values are retrieved for criteria and attributes, except that an attribute might also have an associated domain that provides values, passing them to the handler class. If this is the case, you do not need to implement any logic for these attributes.
    Whether the requested values apply for a criterion or an attribute is indicated by the value passed in the parameter IV_TECTYPE of the method GET_DDLB_VALUES. The ID passed in IV_ID identifies either a criterion or an attribute, depending on the value in IV_TECTYPE.
    For a language-specific determination of values, the language is passed additionally in the parameter IV_LANGU (in the standard, this parameter is used in the initial load of classification values to SAP NetWeaver BI).
    Mutual dependency of criteria (in the standard there is a mutual dependency of the criteria SALES_ORG, DIST_CHANN, and DIVISION, which together form a valid sales area) can be realized by retrieving values already entered for criteria other than those currently requested. The values already entered for the current classification "line# are passed in the parameter IS_CURRENT_CRITERIA.
  • Method GET_VH_DESCRIPTION
    The type of value help for any criterion or attribute value is by default a dropdown list box. This applies if there is no implementation of the method GET_VH_DESCRIPTION for a criterion or attribute.
    If a value help other than a DDLB is required, such as a standard input help using a DDIC search help, the method GET_VH_DESCRIPTION needs to be redefined and implemented.
    To do this, simply copy the code of the existing implementation of the method in the class CL_CRM_BUPA_CLASSIFICATION to your implementation and make the necessary adjustments.
    This basically involves changing the parts of code that check the technical type and ID passed. This can be done by setting values for LV_F4_ATTR1, LV_F4_ATTR2, EV_HELP_ID, and EV_HELP_ID_KIND. A prerequisite is that a DDIC search help exists for your value table.
    Note
    If you opt for your own value help for criteria or attributes (using a DDIC search help), you need to implement the logic in the method GET_DDLB_VALUES for the relevant criterion or attribute, as this method method is called when the values entered are validated in the API.

Scenario 3. Overriding Values and Value Help for Standard Criteria and Attributes

If you want to override the logic of the value determination for determination for standard criteria or attributes, you need to create your own handler class as a subclass of the class CL_CRM_BUPA_CLASSIFICATION.
By redefining the method GET_DDLB_VALUES and implementing your own logic, your values will be considered when maintaining the classification, regardless of the classification type.
To do this, you have to enter your handler class instead of the standard handler class CL_CRM_BUPA_CLASSIFICATION for the criterion or attribute in the view cluster CRMVC_BUPA_CLASS.
By calling the method GET_DDLB_VALUES of the superclass within your implementation of the method GET_DDLB_VALUES, you can retrieve standard values and modify the value range.
Changing the handler class associated with a criterion or attribute in Customizing does not entail a modification.
Powered by Blogger.