on 10-29-2009 1:57 PM
Hi,
I need to add a column to the iHistResult view. The column does not exist in BOL entity BTOrder attribute list. I am trying to add the Contact Person to the results list. ( Header Partner Function-Contact Person ). Any suggestions on how to proceed? We are using CRM 5 and I am new to CRM, so please provide as much step-by-step detail as your time permits.
Thanks,
John.
Hi John,
I am out of touch with CRM 5 for quite a while but certainly give you the idea. What you have to do is copy your BSP application into Z application -> In CRM 7.0 we call this step as component enhancement. There is some controller setting you need to do in order to call the Z application instead of SAP standard (I don't remember the SPRO path on top of my mind).
Now in your custom application go the contaxt node and add the value attribute to the node since it is not supported by BOL. In the GET_TABLE_LINE_SAMPLE method of your context node add your custom attribute and then in Get method you can retrive the data to display on the screen. I am assuming you do not want to save it to any field so you do not need any code in Set method.
Hope this will give you some direction.
Thanks,
Vikash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks...I was able to add the additional field and it appears in the view; however, I am getting the following displayed in the field. I'm guessing there is some additional code required for my new field. I've named the new field "FULLNAME" and the message that appears is as follows:
BuilHeader/FULLNAME not bound
The GET* methods for the field were generated. Any suggestions?
Thanks
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your Get_FULLNAME method should look like this.. (If you have used the wizard properly, as i mentioned...) check the method...
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
value =
'BTOrder not bound'."#EC NOTEXT
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
TRY.
DATA: coll TYPE REF TO if_bol_entity_col.
DATA: entity TYPE REF TO cl_crm_bol_entity.
entity ?= current.
coll = entity->get_related_entities(
iv_relation_name = 'BTOrderHeader' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
entity ?= current.
coll = entity->get_related_entities(
iv_relation_name = 'BTHeaderPartnerSet' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
entity ?= current.
coll = entity->get_related_entities(
iv_relation_name = 'BTPartner_00000015' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
TRY.
dref = current->get_property( 'DESCRIPTION_NAME' ). "#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 IS NOT BOUND.
value =
'BTOrder/BTOrderHeader/BTHeaderPartnerSet/BTP... not bound'."#EC NOTEXT
RETURN.
ENDIF.
TRY.
value = if_bsp_model_util~convert_to_string( data_ref = dref
attribute_path = attribute_path ).
CATCH cx_bsp_conv_illegal_ref.
FIELD-SYMBOLS: <l_data> type DATA.
assign dref->* to <l_data>.
please implement here some BO specific handler coding
conversion of currency/quantity field failed caused by missing
unit relation
Coding sample:
provide currency, decimals, and reference type
value = cl_bsp_utility=>make_string(
value = <l_data>
reference_value = c_currency
num_decimals = decimals
reference_type = reference_type
).
CONCATENATE <l_data> '-CURR/QUANT CONV FAILED-' INTO value
SEPARATED BY space. "#EC NOTEXT
CATCH cx_root.
value = '-CONVERSION FAILED-'. "#EC NOTEXT
ENDTRY.
Thanks Sreekantha,
I went back to your step-by-step to create the new attribute but I am not able to paste in the path you indicated below. The only option for the BOLAttribute field is CRM_GUID. I have the following in the Add Attribute screen:
Attrib Name: CONTACTPERSON
BOL Entity: BTOrder
BOLAttibute: ???
I could not past in 'BTOrder-BTOrderHeader/BTHeaderPartnerSet/BTPartner_00000015/DESCRIPTION_NAME' in the BOLAttribute field.
4. wizard pops up and give a name contactperson for the attribute, and keep the BTORDER as model node, and for the BOL attribute, copy the following path.
BTOrder-BTOrderHeader/BTHeaderPartnerSet/BTPartner_00000015/DESCRIPTION_NAME
Finish the wizard.
Thanks,
John.
Hi Sreekanth,
I did try the code below in my GET_FULLNAME method. The code I used is below. I tried switching out the "DESCRIPTION_NAME" to the attribute name that I created "FULLNAME" but I still get the message 'BTOrder not Bound' in the FULLNAME column of the iHistResult view. The message appears for all rows in the view. Thanks for all your help and any more suggestions are greatly appreciated.
The code for my GET_FULLNAME method is below:
method GET_FULLNAME.
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
value = 'BTOrder not bound'. "#EC NOTEXT
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
TRY.
DATA: coll TYPE REF TO if_bol_entity_col.
DATA: entity TYPE REF TO cl_crm_bol_entity.
entity ?= current.
coll = entity->get_related_entities( iv_relation_name = 'BTOrderHeader' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
entity ?= current.
coll = entity->get_related_entities( iv_relation_name = 'BTHeaderPartnerSet' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
entity ?= current.
coll = entity->get_related_entities( iv_relation_name = 'BTPartner_00000015' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
TRY.
*dref = current->get_property( 'DESCRIPTION_NAME' ). "#EC NOTEXT
dref = current->get_property( 'FULLNAME' ). "#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 IS NOT BOUND.
value = 'BTOrder/BTOrderHeader/BTHeaderPartnerSet/BTP... not bound'. "#EC NOTEXT
RETURN.
ENDIF.
TRY.
value = if_bsp_model_util~convert_to_string( data_ref = dref
attribute_path = attribute_path ).
CATCH cx_bsp_conv_illegal_ref.
FIELD-SYMBOLS: <l_data> type DATA.
assign dref->* to <l_data>.
please implement here some BO specific handler coding
conversion of currency/quantity field failed caused by missing
unit relation
Coding sample:
provide currency, decimals, and reference type
value = cl_bsp_utility=>make_string(
value =
reference_value = c_currency
num_decimals = decimals
reference_type = reference_type * ).
CONCATENATE <l_data> '-CURR/QUANT CONV FAILED-' INTO value SEPARATED BY space. "#EC NOTEXT
CATCH cx_root.
value = '-CONVERSION FAILED-'. "#EC NOTEXT
ENDTRY.
endmethod.
Thanks,
John.
Hi,
you should use 'DESCRIPTION_NAME' only .
I think you might be using a new partner function (Z partner function). I would suggest you to put a break point in the starting point of this method, and debug it from there.
If you see your data in some other partner function, you can change the method accordingly.
thanks,
Sreekanth
Hi,
follow the steps..
1. copy the view CRM_IC/IHistResult to your Z BSP ApplicationZCRM_IC/IHistResult using TCODE, BSP_WD_WORKBENCH( note: give the same name for the view).
2. Now open your ZBSP Application fron above TCODE, and double click on the view.
3. Open the node context node and then open the node attributes, right click there and select create new attribute.
4. wizard pops up and give a name contactperson for the attribute, and keep the BTORDER as model node, and for the BOL attribute, copy the following path.
BTOrder-BTOrderHeader/BTHeaderPartnerSet/BTPartner_00000015/DESCRIPTION_NAME
Finish the wizard.
5. That create a Z implementation class and Z context class and X context node class.
6. Now open the Z context node class, and select method GET_TABLE_LINE_SAMPLE and redefine it, and copy the following code there, between method and endmethod.
CREATE DATA rv_sample TYPE ltype_tabline.
7. Now double click on ltype_tabline , it prompts you whether to create new local type .. say yes, and copy the following code there.
TYPES:
BEGIN OF ltype_tabline,
act_date TYPE sydatum,
act_time TYPE sytime,
category_txt TYPE crmt_description_20,
description TYPE crmt_process_description,
object_id TYPE crmt_object_id,
stat_txt TYPE j_stext,
created_by TYPE crmt_created_by,
object_type_txt TYPE crmt_description,
CONTACTPERSON type TEXT30,
*{ INSERT A4IK008834 1
introduction of icons
icon type iconname,
*} INSERT
END OF ltype_tabline.
8. now go to htm page of the view.
add the following code to show the table column on the view.
<crmic:tableViewColumn columnName = "CONTACTPERSON"
title = "CONTACTPERSON" />
if you add the above code, after this code, the contact person will be shown at the end.
<crmic:tableViewColumn columnName = "CREATED_BY"
title = "<%= otr(crm_ic_appl/irecauthor) %>" />
Activate all the classes and htm page.
9. In SPRO, replace the controller for your runtime framework profile to call the z view.
img->crm-> Interaction Center WebClient->Customer-Specific System Modifications->....
here i believe its the first entry.
there you have to replace CRM_IC IHistResult with ZCRM_IC IHistResult
Thanks,
Sreekanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.