on 08-25-2015 2:30 PM
Hi Kalpana,
CRMD_CUSTOMER_H was delivered in early versions to handle customer extensions to business transactions at header level. So, one solution for your problem would be to evaluate the creation of the new fields in this table.
Kind regards,
Bruno
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Burno,
Thanks for your reply.but if i have created customer_h fields,i want to add this fields on service order creation screen heade level.. but the fields are not available.because customer_h context node is not available on Service order header component.shall i create customer_h context node on service order component ?is it corret?could you please help here..
Thanks
kalpana
Hi,
You have exceeded the number of fields limit in orderadm_ table due to that you are getting the error. But as Bruno suggested you should use customer_h extension to create custom fields.
I hope you have already created new field in customer_h, just you need to create customer_h context node within the view you want to add field in web ui.
You can change the configuration to add the customer_h field in web ui.
Regards,
Dharmakasi.
Hi kasi,
Thanks For your reply.
I have created Context node on component - btcategories,view - BTCATEGORIES/Categories ,
Context node- rightl click i have created context node BTCUSTOMERH..after i have added all the fields on view level.but the fields showing disable and btcustomer_h is not bound.please help here.
Thanks&Regards
Kalpana
Hi,
You need to make the binding between the btcustomerh in category view and context node in your service order main component BT116H_SRVO.
You need to make the context node binding similar to the BTCATEGORYFIRST. You can check how the category context node binds, the same approach you can do it for customer h as well.
Regards,
kasi.
Hi Kalpana,
Don't think you should had those fields in component BTCATEGORIES, since it's a kind of generic component used by some business transactions to display only categories. Notice that you don't have context node for CRMD_ORDERADM_H there also...
If still, you want to go ahead, you have to redefine the methods IF_BSP_MODEL~INIT to initialize your model and add your CRMD_CUSTOMER_H entity as a context node. You'll might have to consult the GDC controllers to get the main entity for the business transaction that is being displayed.
My suggestion, since those fields are service order header fields, would be to place them in service order header fields component where the other header fields are being displayed.
Hope that this help you a little more.
Kind regards,
Garcia
Hi Garcia,
Thanks For your reply.
.
I am still confusing.i guess i did wrong approach..Is it possible to remove added context node CUSTOMER_H on BTCATEGORIES?
According to your suggestion ,Now fields are available on Customer_h ,shall i want to add again context node Customer_h on BT116H_SRVO details view?or could you please elaborate..if you give any inputs its really appreciate .
Thanks for your great help.
Thanks&Regards
Kalpana
Hi Kasi,
before adding BTCUSTOMERH context noode in BT116h_SRVO ,i need to delete the context node on btcategories component .previously i am adding the BTCUSTOMER_H context node ,so first i need to delete that one..
2->component- BT116h_srov
VIew - details-
Context node - BTCUSTOMERH
after adding this context node,view configuration
Thanks
Kalpana
Hi kasi,
Thanks for your reply.
i have one more confusion.instead of creating entire customer_h context node on BT116h_SRVO, in BTADMINH context node -attributes -right click create attribute ,
provide - attribute name and bol entity- BTADMINH, Bol attribute - BTHeaderCustExt from here customer _H fields availble shall i go this approach? and is this right approach ? or better to create context node on BT116h_srvo?
Thanks
kalpana
Hi kasi,
In get mehod code is like as below after adding field automatically getter methods generted and it is redefined all the fields ,get_i method it is disabled.
METHOD get_warranty.
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
value =
' '."#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 = 'BTHeaderCustExt' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
TRY.
dref = current->get_property( '/RCRM/F005H' ). "#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 = ' '."#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
* ).
value = '-CURR/QUANT REF DATA MISSING-'.
CATCH cx_root.
value = '-CONVERSION FAILED-'. "#EC NOTEXT
ENDTRY.
ENDMETHOD.
method SET_WARRANTY.
DATA:
current TYPE REF TO if_bol_bo_property_access,
dref TYPE REF TO data,
copy TYPE REF TO data.
FIELD-SYMBOLS:
<nval> TYPE ANY,
<oval> TYPE ANY.
* get current entity
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
* get old value and dataref to appropriate type
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 = 'BTHeaderCustExt' ). "#EC NOTEXT
current = coll->get_current( ).
IF current IS NOT BOUND.
RETURN.
ENDIF.
TRY.
dref = current->get_property( '/RCRM/F005H' ). "#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.
* assure that attribue exists
CHECK dref IS BOUND.
* set <oval> to old value
ASSIGN dref->* TO <oval>.
* create a copy for new value
CREATE DATA copy LIKE <oval>.
* set <nval> to new value
ASSIGN copy->* TO <nval>.
* fill new value using the right conversion
TRY.
* TRY.
CALL METHOD if_bsp_model_util~convert_from_string
EXPORTING
data_ref = copy
value = value
attribute_path = attribute_path.
* CATCH cx_bsp_conv_illegal_ref.
* FIELD-SYMBOLS: <l_data> type DATA.
* assign copy->* 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 for currency fields or decimals for quantity (select from T006).
* cl_bsp_utility=>instantiate_simple_data(
* value = value
* reference = c_currency
* num_decimals = decimals
* use_bsp_exceptions = abap_true
* data = <l_data> ).
* ENDTRY.
CATCH cx_sy_conversion_error.
RAISE EXCEPTION TYPE cx_bsp_conv_failed
EXPORTING
name = 'Warranty'."#EC NOTEXT
ENDTRY.
* only set new value if value has changed
IF <nval> <> <oval>.
current->set_property(
iv_attr_name = '/RCRM/F005H' "#EC NOTEXT
iv_value = <nval> ).
ENDIF.
endmethod.
Hi garcia,
affter creating BTCUSTOMERH context node on bt116hsrvo component ,all fields available in configuration, i have added 3 fields on configuration ,and implementing drop down logic.here 1st drop down user selecs second drop values filled and based on 2dn drop down 3rd down values get filled.now i am trying to implementing the logic i am gettin error like as below,here ineed to do any binding or initialization?
Hi Kalpana,
If the goal is to initialize BTCUSTOMERH, I don't think you need to do anything there. In the wizard tool that is opened when you create BTCUSTOMERH context node, you can bind your desired entity through relationship BTHeaderCustExt with already define node BTADMINH. That should be enough.
Also, select also checkbox 'allways create instance' so that this relationship is always initiated.
If the goal is to do some other logic with BTCUSTOMERH node in that method, then you can access it using variable ZTYPED_CONTEXT and not TYPED_CONTEXT.
Kind regards,
Garcia
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
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.