Hi,
I want the Product field in the activity search Result list.
Since the field is not available in the context "BTQRACT". I created a field "ZPRODUCT " by using the wizard and used the BOL entity as BTAdminI and the appropriate attribute ORDERED_PROD.
Now i am modifying the GET_ZPRODUCT method so as to get the result list populated with correct values.
Following is the code:
METHOD get_zproduct.
DATA: current TYPEREFTO if_bol_bo_property_access.
DATA: dref TYPEREFTOdata.
DATA: lr_entity TYPEREFTO cl_crm_bol_entity.
DATA: lr_product TYPE string. "REF TO CRMT_ORDERED_PROD_DB.
value =''. "#EC NOTEXT
IF iterator ISBOUND.
current = iterator->get_current( ).
ELSE.
current = collection_wrapper->get_current( ).
ENDIF.
lr_entity ?= current.
lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTADVSAct' ).
IF lr_entity ISBOUND.
lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTOrderHeader' ).
IF lr_entity ISBOUND.
lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTOrderDocFlowSet' ).
IF lr_entity ISBOUND.
lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTDocFlowAll' ).
IF lr_entity ISBOUND.
lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTAdminI' ).
IF lr_entity ISBOUND.
lr_product = lr_entity->get_property_as_string( 'ORDERED_PROD' ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
current ?= lr_entity.
TRY.
dref = current->get_property( 'ORDERED_PROD' ). "#EC NOTEXT
CATCH cx_crm_cic_parameter_error.
ENDTRY.
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.
IF dref ISNOTBOUND.
value = 'BTAdminI/ORDERED_PROD not bound'. "#EC NOTEXT
RETURN.
ENDIF.
i found out the relation from the GENIL_MODEL_BROWSER. But while debugging I discovered that the Object BTQRACT has relation only upto relation: "BTOrderHeader" after that the relations table is found to be blank.
How can i acheive my relation properly and get the result correctly?
Kindly suggest.