Skip to Content
0
Former Member
Jul 31, 2012 at 04:21 AM

Account Search Requirement

20 Views

Hi,

I am working on a requirement wherein I need to create new custom fields in result view of Account search page.

To populate the values in newly created field, I have written the logic in DO_PREPARE_OUTPUT of BP_HEAD_SEARCH component and view

BP_HEAD_SEARCH/MainSearchResult . but in the code current entity is not storing the values of new fileds in the end.

Kindly help in this regard.Below is the code :

method do_prepare_output.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
EXPORTING
IV_FIRST_TIME = ABAP_FALSE
.

data: current TYPE REF TO if_bol_bo_property_access,
lr_current TYPE REF TO cl_crm_bol_entity,
lr_col TYPE REF TO if_bol_entity_col,
lr_relid TYPE REF TO cl_crm_bol_entity,
idnumber type string,
idtype type string,
lv_size type SYTABIX.

current = me->typed_context->result->collection_wrapper->get_current( ).
lr_current ?= current.

IF lr_current IS BOUND.
lr_current->get_related_entities( EXPORTING iv_relation_name = 'BuilIdentificationRel' RECEIVING rv_result = lr_col ).
ENDIF.

IF lr_col IS BOUND.
lr_relid = lr_col->GET_first( ).
ENDIF.


If lr_relid is bound.
lr_relid->get_property_as_string( EXPORTING iv_attr_name = 'IDENTIFICATIONNUMBER' RECEIVING rv_result = idnumber ).
lr_relid->get_property_as_string( EXPORTING iv_attr_name = 'IDENTIFICATIONTYPE' RECEIVING rv_result = idtype ).

CALL METHOD LR_CURRENT->IF_BOL_BO_PROPERTY_ACCESS~SET_PROPERTY
EXPORTING
IV_ATTR_NAME = 'ZZAFLD000007'
IV_VALUE = idtype.

CALL METHOD LR_CURRENT->IF_BOL_BO_PROPERTY_ACCESS~SET_PROPERTY
EXPORTING
IV_ATTR_NAME = 'ZEXTID1'
IV_VALUE = idnumber.

endif.
endmethod.