Wednesday, March 23, 2011

Changing the Work Area Title of an overview page

In the CRM Webclient, every overview page you call has a caption in the header. This caption gives you information of the data below. For instance, in the BP_HEAD/BPHEADOVERVIEW, the account number and the address is shown. In the BT126H_CALL/SALESCALLOVVIEWSET for instance, the information is the transaction type and transaction description.


In some cases you might want to add information to this Work Area Title. This would be particularly useful if you are dealing with information that is important to the agent, but is not available in any assignment block. For instance, you might consider:
  • Calling ERP te retrieve the total due amount for this customer
  • Add the age of the customer if this is relevant
  • Add the current customer lifecycle
  • Add the customer's segment
  • Add the customer's loyalty points
  • Add the userstatus of the transaction
If you want to do this, you should find the relevant window (so not the overview page itself), and enhance the method IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION under the node "Breadcrumbs and Messages".

As always, it is preferred to first call the super class (have SAP do it's own coding), and after that add information to the description. Use the typed context to read information from the BOL.

4 comments:

  1. Hi Pieter, thanks for this bit of info much appreciated! Have you perhaps got some sample code to share how to set the overview page title, the GET_STATE_DESCRIPTION method only returns the current title.
    Thanks lots!
    Mark

    ReplyDelete
  2. Sure :-)

    First call the super class.
    CALL METHOD super->if_bsp_wd_history_state_descr~get_state_description
    EXPORTING
    iv_current_description = iv_current_description
    RECEIVING
    description = description.

    Then do your own coding.
    You can access the context from the me->typed_context.

    lr_typed_context ?= me->ztyped_context.

    Then retrieve data from the context node.
    For instance:

    lr_builheader ?= lr_typed_context->builheader.
    lr_coll_wrapper = lr_builheader->get_collection_wrapper( ).
    lr_bol_access = lr_coll_wrapper->get_first( ).
    lr_customer ?= lr_bol_access.
    lv_fullname = lr_customer->get_property_as_string( iv_attr_name = 'FULLNAME' ).

    Hope this helps. If not, feel free to email me directly on pieter.rijlaarsdam@acorel.nl

    ReplyDelete
  3. Oh, and of course move the results to the exporting parameter DESCRIPTION.

    ReplyDelete
  4. A remark: I had to execute a /$SYNC command to see my changes in the SOTR_EDIT on the Web UI.

    ReplyDelete