on 01-30-2013 3:01 AM
Hi All,
We have a custom field which is created as a numerical field .
When I am trying to enter the field with a numerical value its not getting updated
ie; when I press enter after entering value in UI it disappears .
But when I enter chars it accepts the value .
Code snippet for GET and SET methods are .
************************************
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
value = 'BTCustomerH not bound'."#EC NOTEXT
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
TRY.
TRY.
dref = current->get_property( 'ZZFC_PROBABILITY' ). "#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 = 'BTCustomerH/ZZFC_PROBABILITY 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>.
value = '-CURR/QUANT REF DATA MISSING-'.
CATCH cx_root.
value = '-CONVERSION FAILED-'. "#EC NOTEXT
ENDTRY.
SHIFT value LEFT DELETING LEADING '0'.
IF value = ' '.
value = '0'.
ENDIF.
*************************************
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.
TRY.
dref = current->get_property( 'ZZFC_PROBABILITY' ). "#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_sy_conversion_error.
RAISE EXCEPTION TYPE cx_bsp_conv_failed
EXPORTING
name = 'ZZFC_PROBABILITY'. "#EC NOTEXT
ENDTRY.
* only set new value if value has changed
IF <nval> <> <oval>.
current->set_property(
iv_attr_name = 'ZZFC_PROBABILITY' "#EC NOTEXT
iv_value = <nval> ).
ENDIF.
******************************************
Attached the field properties
Done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naval,
I'm facing the same issue. Would please provide the code in M method.
AET wont support to add field to BTREFOBJ ,so I added date field in BOL Structure and added to config . I can choose the value of date , as soon as i hit enter value disapper. In set method dref is not bound. Suggest me how to fix the issue.
Thanks,
Naveen.
hi,
I am facing similar problem, text or numeric entries not getting set, it is an model custom attribute but not getting set, How did you solve it..
thanks
Dhinesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to set the appropriate meta data value for the field type . its either the _M_ or the _P_ method. Implement them as well.
Reward points if problem is fixed.
Cheers
Chetan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
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.