Wednesday, 28 May 2014

Provide a standard F4 Help for a customer field

Code snippet to provide a standard F4 Help for a customer field as follows:

Generate a V-Getter method of a field that you want provide F4 Help.

Use following code with some appropriate changes as per requirement.

  DATA:
          ls_map     TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
          lt_inmap   TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
          lt_outmap  TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.

          ls_map-context_attr = 'STRUCT.XXXXX'.                      * provide field name
          ls_map-f4_attr        =  'XXXXX'.                                      * provide search help parameter
         APPEND ls_map TO:  lt_outmap.

  CREATE OBJECT rv_valuehelp_descriptor TYPE
    cl_bsp_wd_valuehelp_f4descr
    EXPORTING
      iv_help_id        = 'XXXXX'                                                   * provide search help name
      iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
      iv_input_mapping  = lt_inmap

      iv_output_mapping = lt_outmap. 




Tuesday, 27 May 2014

How to add customer fields to the configuration tab in webUI

Steps to add customer fields to the configuration tab in WEBUI as follow:


  • Go to transaction code - 'SPRO'
  • Click on, Customer Relationship Management
  • Click on, UI Framework
  • Click on, UI Framework Definition
  • Click on, Design Layer
  • Click on, Copy SAP Design Objects
  • Click on, Position & search for object type.  
  • Object type can be found, by pressing F2(To get technical     details)on a search view where you want to a field.( for     example, for activity search, the object type                 is BT126_APPT.
  • Now select the corresponding object type & click on 'Design object'.( for example Design object for activity search     is BTQACT or BTQRACT)
  • Now,select the appropriate 'Design object' & click on 'Copy from SAP' if you adding a custom field first time in this   particular design object,otherwise click on 'Goto Copies'.
  • By selecting 'Design object', click on 'Design' in dialog   structure.
  • Now click on, 'New Entries'.

    

  • Provide following details:
     Attribute Name
     Object
     Attribute
     Field Label
    
     If needed, you can provide value help for a field.

  • Finally, click on save.

Activity Search Enhancement

Things to remember while enhancing the activity search:

  • Genil handler class for activity search enhancement:

    cl_crm_qact_run_btil

  • Class-method where the activity search result is filtered out:

    if_crm_query_runtime_btil~get_dynamic_query_result


Steps for replacing a standard activity search class with a
custom class

  • Go to transaction code 'SPRO'.
  • Click on, Customer Relationship Management
  • Click on, CRM Cross-Application Components
  • Click on, Generic Interaction Layer/Object Layer
  • Click on, Component-Specific Settings
  • Click on, Business Transactions
  • Click on, Define Custom Handler Classes for Business                       Transaction Model Nodes
  • Click on, New Entries .

    
Add caption
  • Finally, click on save.
    


Issue while saving the business transactions in IC business role for ex. Opportunity save

Standard behavior of Interaction center business role while saving the business transaction:

When a user saves any transaction,by default it remains in edit mode instead of save mode.

Solution:

SAP Note 1457641 - Interaction center: distribution lock on save.

Above note has suggested following steps:


  • Add following entry to table 'SMOFPARSFA' via transaction code SM30.
    Key            = 'CRMIC'
  
    Paramname      = 'NO_DISTRIBUTION_LOCK_ON_SAVE'

    Paramname2     = specify a business role

Tuesday, 20 May 2014

Define/Read Transaction Types

Steps for defining/reading transaction types:


* Go to transaction - SPRO

* Click on, Customer Relationship Management

* Click on, Transactions

* Click on, Basic Settings

* Click on, Define Transaction Types

* Click on, New Entries

* Make your entries & click on, save.

Code to read the current business role, user logged into.

       DATA:       lr_profile          TYPE REF TO cl_crm_ui_profile ,
                         lv_role             TYPE        string . 

      lr_profile ?= cl_crm_ui_profile=>get_instance( ).

      IF lr_profile IS BOUND.
        CALL METHOD lr_profile->if_crm_ui_profile~get_profile
          RECEIVING
            rv_result = lv_role.
      ENDIF.

You will get the business role, in lv_role variable.