Code: Alles auswählen.
DATA lr_core TYPE REF TO cl_crm_bol_core.
DATA lv_query_name TYPE crmt_ext_obj_name.
DATA lr_query_service TYPE REF TO cl_crm_bol_dquery_service.
DATA ls_param TYPE crmt_name_value_pair.
DATA lt_param TYPE crmt_name_value_pair_tab.
DATA lr_result TYPE REF TO if_bol_bo_col.
DATA lo_query_entity TYPE REF TO cl_crm_bol_entity.
DATA lo_query_entity TYPE REF TO cl_crm_bol_entity.
lr_core ?= cl_crm_bol_core=>get_instance( ).
lr_core->load_component_set( 'IBASE_ONLY' ).
lr_query_service ?= cl_crm_bol_dquery_service=>get_instance( 'IBIBaseToIBaseAdv' ).
ls_param-name = 'MAX_HITS'.
ls_param-value = pa_max.
APPEND ls_param TO lt_param.
lr_query_service->set_query_parameters( lt_param ).
* Get query result
lr_result ?= lr_query_service->get_query_result( ).
IF lr_result IS BOUND AND lr_result->size( ) > 0.
lo_query_entity ?= lr_result->get_first( ).
WHILE lo_query_entity IS BOUND.
TRY.
lr_entity_zk = lo_query_entity->get_related_entity( 'FirstLevelComponent' ). --> kann ich bereits hier den Fehler vermeiden??
IF lr_entity_zk IS BOUND.
...