cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add a column to the Result for BT111S_OPPT

paul_dunk
Explorer
0 Kudos

Hi,

I have a requirement to include a header level partner in the Results view of BT111S_OPPT. It is already possible to search by this partner function but the partner column is not available on the view 'BT111S_OPPT/Result'. My research has pointed me toward using the "ITERATOR" but a related blog was not available and I must admit that I am rather confused as to how to use the "ITERATOR". I am assuming that I can use it to GET->CURRENT but then I don't know what to do after that.

Any help is appreciated as we are under time pressure. Thanks.

Cheers,

Paul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

iterators are normally used to convert data in lists which are already evaluated.

In your case you better add a new column to the result list node and implement the getter with your own

code. This would look quite similar like (just an example)

#################################################

METHOD get_po_number_ship.

DATA:

lv_po_number_ship TYPE crmt_po_number_ship,

lr_current TYPE REF TO if_bol_bo_property_access,

lr_entity TYPE REF TO cl_crm_bol_entity.

IF iterator IS BOUND.

lr_current = iterator->get_current( ).

ELSE.

lr_current = collection_wrapper->get_current( ).

ENDIF.

TRY.

lr_entity ?= lr_current.

lr_entity ?= lr_entity->get_related_entity( iv_relation_name = 'BTItemSalesSet' ).

IF lr_entity IS BOUND.

lr_entity->get_property_as_value( EXPORTING iv_attr_name = 'PO_NUMBER_SHIP'

IMPORTING ev_result = lv_po_number_ship ).

ENDIF.

CATCH cx_sy_ref_is_initial.

RETURN.

ENDTRY.

value = lv_po_number_ship.

ENDMETHOD.

#################################################

Regards,

Wolfhard

Answers (1)

Answers (1)

paul_dunk
Explorer
0 Kudos

Hi Wolfhard,

Thanks very much for your speedy help. It is definitely appreciated.

My manager found another thread that pointed me to the search Badi called from the method get_result_values in class CL_CRM_Q1O_SEARCH. This was very fortuitous since the field we need to display in the report is END_CUSTOMER_NAME. Since this field is already included in the structure CRMT_REPORT_LOCATORLIST and is already filled in the function module CRM_BSP_OIC_1O_READ_FROM_RF then all I had to do was append the field END_CUSTOMER_NAME to the structure CRMST_QUERY_R_OPP_BTIL. This made the column available to be used in the results view for Opportunities.

I suspect that if we were adding a field that was not already being filled in function module CRM_BSP_OIC_1O_READ_FROM_RF then we could have used the Badi called from the method get_result_values in class CL_CRM_Q1O_SEARCH and filled our new column in the Badi.

However, your answer has been educational to me and very much appreciated. Thanks.

Cheers,

Paul