Hi ,
I am trying to retrieve contact person data based on the email id using BOL programming in custom Function Module .
Below is the code :
Data : lr_core TYPE REF TO cl_crm_bol_core.
DATA: lr_qs TYPE REF TO cl_crm_bol_dquery_service,
ls_param TYPE crmt_name_value_pair,
lt_param TYPE crmt_name_value_pair_tab,
lr_result TYPE REF TO if_bol_entity_col,
lr_iter TYPE REF TO if_bol_entity_col_iterator,
lr_entity TYPE REF TO cl_crm_bol_entity.
DATA : low TYPE string.
TRY.
lr_core = cl_crm_bol_core=>get_instance( ).
lr_core->load_component_set( 'BTBP' ) .
CATCH cx_crm_genil_general_error.
ENDTRY.
*Get and prepare dynamic query service.
lr_qs ?= cl_crm_bol_dquery_service=>get_instance('BuilContactAdvancedSearch').
* Set Query Parameters.
ls_param-name = 'MAX_HITS'.
ls_param-value = '5'.
APPEND ls_param TO lt_param.
lr_qs->set_query_parameters( lt_param ).
*Add selected parameters or criteria .
low = " Input email Id in string
lr_qs->add_selection_param( iv_attr_name = 'EMAIL'
iv_sign = 'I'
iv_low = low
iv_option = 'EQ'
iv_high = ' ').
lr_result = lr_qs->get_query_result( ).
CHECK lr_result IS BOUND.
*Use Iterator to access entities in query result
lr_iter ?= lr_result->get_iterator( ).
* Get the first record from Collection.
lr_entity ?= lr_iter->get_first( ).
WHILE lr_entity is BOUND.
lr_entity ?= lr_iter->get_next( ).
ENDWHILE.
But here in I am getting value in lr_result but all the values in lr_entity are blank.
Please suggest a solution for it .