Skip to end of metadata
Go to start of metadata

Link to Content's target Space :

Applies to:

SAP CRM WEB UI version 6.0 or more 


This paper tells how SAP stores information in global data context and how it retrieves the data from global data context and also the relevant customizing for the same.


Company:     IBM Pvt Ltd
Created on:   12.1.2011
Author(s) Bio

I have 6 years of experience in SAP CRM. My key areas are Web ui and CRM technical and functional. 

Table of Contents

Customizing For Global Data Context

In the customizing of global data context (shown below) you define the name of the parameter and the relevant bol object.

For eg: we will consider the example of current customer. First we will define a parameter "CURRENTCUSTOMER" and the bol object for BP, which is "BuilHeader" in External Object Name

Reading and Writing the data into Global Data Context

Depending upon our business requirement we can first set the data and later retrieve the data from GDC.

//Below is the code for reading the data from global data context and writing the data into global data context

*************To set the global context data.
    bp               TYPE string,
    lr_qs            TYPE REF TO cl_crm_bol_query_service,
    lr_col           TYPE REF TO if_bol_bo_col,
    lr_bdc        TYPE REF TO if_crm_ui_data_context,
    lr_prop_bp       TYPE REF TO if_bol_bo_property_access.
        Bp = ‘10000XXXXX’.   (your business partner).
*       Get the entity for the partner
        lr_qs = cl_crm_bol_query_service=>get_instance( 'BuilHeaderSearch' ).
        lr_qs->set_property( iv_attr_name = 'PARTNER' iv_value = bp ).
        lr_col = lr_qs->get_query_result( ).
        lr_prop_bp = lr_col->get_first( ).
*   Get the Global Data context
  lr_bdc = cl_crm_ui_data_context_srv=>get_instance( me ).
*       add the business partner entity to global data container for parameter CURRENTCUSTOMER
          name  = 'CURRENTCUSTOMER'                         
          value = lr_prop_bp ).

*************To read the data from the global data context.  
    lr_bdc        TYPE REF TO if_crm_ui_data_context,
     lr_bp         TYPE REF TO if_bol_bo_property_access.
* get bp
  lr_bdc = cl_crm_ui_data_context_srv=>get_instance( me ).
  CHECK lr_bdc IS BOUND.
  lr_bp = lr_bdc->get_entity( name  = 'CURRENTCUSTOMER' ).

 For more details, please go through the standard class and method, shown in the screenshot below.

Thanks & Regards,

Abhilash Menon.

Related Content