on 09-02-2014 4:24 PM
I want the read the value of a field,'LCSTATUS' belonging to context node 'BTADMINH' in the GET_I method of the field, 'ZZFLD000008' belonging to context node,'ZBTACTIVITYH'.
In the context node class of context node 'ZBTACTIVITYH',I have created an instance attribute,GR_OWNER type ref to context class.
I get the following error in the line - lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ).
'An exception (CX_CRM_CIC_PARAMETER_ERROR) occurred Message no. TPDA430'
I have used the below code.
method GET_I_ZZFLD000008.
DATA: current TYPE REF TO if_bol_bo_property_access,
lv_act_status TYPE string.
DATA:lr_entity TYPE REF TO cl_crm_bol_entity,
lr_current TYPE REF TO if_bol_bo_property_access,
lr_parent TYPE REF TO cl_crm_bol_entity.
rv_disabled = 'TRUE'.
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
CHECK gr_owner IS BOUND.
lr_entity ?= gr_owner->btadminh->collection_wrapper->get_current( ).
CHECK lr_entity IS BOUND.
lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ). "error states that lcstatus can't be used here.
TRY.
IF current->is_property_readonly(
'ZZFLD000008' ) = abap_false. "#EC NOTEXT
rv_disabled = 'FALSE'.
ENDIF.
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
RETURN.
ENDTRY.
endmethod.
Hi
You get parameter exception usually if the attribute name is wrong.Check if there is any problem with the attribute name. Try to get all the properties using the method get_properties.
Regards JP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
LCSTATUS is not an attribute of the BTADMINH structure. It is read using the relation to the status object
BTADMINH-> BTHeaderStatusSet-> BTStatusHCurrent-> ACT_STATUS.
Try reading the ACT_STATUS of object BTStatus as given below.
data: coll type ref to if_bol_entity_col.
data: entity type ref to cl_crm_bol_entity,
lv_act_status TYPE string.
entity ?= current. "BTADMINH entity.
coll = entity->get_related_entities(
iv_relation_name = 'BTHeaderStatusSet' ). "#EC NOTEXT
current = coll->get_current( ).
entity ?= current.
coll = entity->get_related_entities(
iv_relation_name = 'BTStatusHCurrent' ). "#EC NOTEXT
current = coll->get_current( ).
try.
lv_act_status = current->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'ACT_STATUS' ).
catch cx_crm_cic_parameter_error.
endtry.
Regards JP
User | Count |
---|---|
5 | |
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.