Wednesday, April 18, 2012

Smart Value Help (SVH) in SAP CRM

As of CRM 7.0, we can use the Smart Value Help in SAP CRM. Standard SAP uses this on for instance the country and language fields.

This article describes how you can use this functionality on other fields like for instance your custom fields, how it works and what you should be aware of (performance wise for instance).






Standard Settings

In order to use the SVH, you should check the following settings:

Businessrole customizing

SAP IMG -> CRM -> UI Framework -> Technical Role Definition -> Define Parameters 
Make sure that in the parameter profile as assigned to your businessrole, the parameter ‘SVH_DISABLED’ has not been set.

SICF Service ‘CRM_CALLBACK’

Make sure that in SICF, service Default_host –> sap –> crm –> crm_callback is active.
 

 

 

 

 

 

 

 

 

How does it work?

Once the user starts typing in the field (for instance in the language field), a piece of Javascript uses service CRM_CALLBACK to retrieve information from SAP CRM on possible values, and uses them to create the dropdown. The Javascript also adds the last 5 entries the user has entered previously. The search help is called using class CL_THTMLB_F4HELP. You can put a breakpoint there if you would like to debug :-).

The SVH uses Javascript code on the page. The Javascript is added to the field in the page while rendering the HTML, and is called SVHManager. You will not have to code anything specific to have the rendering of the page also add the SVH functionality. You just have to comply with the constraints below.

Not all fields are SVH enabled. Actually, not many are. You will have a hard time finding them besides the language and country fields... This is due to the many restrictions in the coding. As said, the SVHManager javascript coding is added during rendering of the HTML, but is only added to the field if it complies to the following constraints:

  • The field must be an input field (handled by the field's GET_P, check http://blog.acorel.nl/2010/08/field-properties-modification-using.html)
  • The field must have a value help assigned of type cl_bsp_wd_valuehelp_f4descr (handled by the get_v).
  • The search help that is assigned in the get_v must have dialog type 'Display values immediately'
  • The search help has to be assigned a single input mapping (iv_input mapping) and a single output mapping (iv_output_mapping).
  • The entries retrieved by the system should not be more than 50.
In all standard SAP SVH implementations, the input mapping is the same as the output mapping, which is the same as the field it is assigned to (resulting in the fact that for instance on the language field, you cannot enter 'Du' and select 'Dutch', but you should enter 'NL' as you can only enter and select the code). It would be better if the entered value and the available selections would be based on a different field in the search help... but I doubt if this is possible.

Another welcome addition to the functionality would be if a predefined DDLB (DropDown ListBox) list in the GET_V, combined with field type 'input field' would also result in the SVH functionality during rendering of the page. That would actually be very nice.

When to implement SVH?

SVH is especially useful when a user should actually select an item from a predefined set, but if a dropdown has to many values. A DDLB with more than 10 values is a potential SVH field. Beware that you will need a simple value help on the field though.

When to avoid SVH?

SVH should definately be avoided if the field has less than 10 possible entries, or more than ... 10000 (depends on your system's performance and the field itself)? As a retrieval from the database is done while the user is entering data, expensive database selections should be avoided, so selections on large or complex checktables should be avoided.

No comments:

Post a Comment