cancel
Showing results for 
Search instead for 
Did you mean: 

how to read value of attributes of different components

Former Member
0 Kudos

HI,

I want to read the value of street in account page (ui component-bp_addr) in eh_onsave (ui component-bp_head).

how to read the value of attribute in different componet.

suggest me.

Thanks,

Brahmaji

Accepted Solutions (1)

Accepted Solutions (1)

former_member192716
Contributor
0 Kudos

Hi,


Data: lr_ent type ref to cl_crm_bol_entity,
         lr_col type ref to if_bol_entity_col.

lr_ent ?= me->typed_context->buil_header->collection_wrapper->get_current( ).

lr_col = lr_ent->get_related_entities( iv_relation_name = 'BuilAddress' ).

lr_ent ?= lr_col->get_first(  ).

lr_ent->get_property_as_value( exporting iv_attr_name = ....street  importing ev_result = lv_street ).

Regards,

Arun

Former Member
0 Kudos

Hi Arun,

Ii am also facing the same problem.

I am new to CRM and as well as BSP, Now the requirement is, at the time of Lead creation, i need to display the customer group 1 value( VIP,KAM etc), and these are sales area specific values. customer code attribute is in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT.

sales area fields are in the UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET.

I have created new field(customer type to display the customer group 1 value "VIP") in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTLEADH.

To display the value in the context node BTLEADH, i need to know the sales area data which is entered in BTORGSET.

Kindly let me know how to achieve above requirement.

As per this thread i applied following code in context node BTLEADH, atttribute New Zfield, in get method, but not able solve, please guide me.

DATA: LR_ENT TYPE REF TO CL_CRM_BOL_ENTITY,

LR_COL TYPE REF TO IF_BOL_ENTITY_COL.

LR_ENT ?= ME->TYPED_CONTEXT->BuilHeader->COLLECTION_WRAPPER->GET_CURRENT( ).

LR_COL = LR_ENT->GET_RELATED_ENTITIES( IV_RELATION_NAME = 'BuilSalesArrangementRel' ).

LR_ENT ?= LR_COL->GET_FIRST( ).

IF LR_ENT IS BOUND.

LR_ENT->GET_PROPERTY_AS_VALUE( EXPORTING IV_ATTR_NAME = 'DIVISION' IMPORTING EV_RESULT = LV_DIVISION ).

ENDIF.

Thanks

Bhanu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arun,

Thanks for your reply,Im getting the following error(exception)

Exception Details

CX_CRM_UNSUPPORTED_RELATION - Relation BuilAddress is not (yet) supported

Method: CL_CRM_GENIL_OBJ_MODEL=>IF_GENIL_OBJ_MODEL~RELATION_IS_CACHEABLE

Thanks,

Brahmaji

FabianJoiris
Active Participant
0 Kudos

Hi,

Replace 'BuilAddress' with 'BuilAddressRel'

Regards,

Fabian

former_member192716
Contributor
0 Kudos

Hi,

Sorry, its BuilAddressRel. Didn't notice.

Regards,

Arun

Former Member
0 Kudos

Hi,

i have declared lv_street as syntax check (lv_street is known).Now Im getting the exception as

CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference

Method: ZL_BP_HEAD_BPHEADOVERVIEW_IMPL=>EH_ONSAVE.

Pls suggest me.

Data: lr_ent type ref to cl_crm_bol_entity,

lr_col type ref to if_bol_entity_col.

data: lv_street type string .

lr_ent ?= me->typed_context->builheader->collection_wrapper->get_current( ).

lr_col = lr_ent->get_related_entities( iv_relation_name = 'BuilAddressRel' ).

lr_ent ?= lr_col->get_first( ).

lr_ent->get_property_as_value(

exporting iv_attr_name = 'STRUCT.STREET'

importing ev_result = lv_street ).

Thanks

Brahmaji

former_member192716
Contributor
0 Kudos

Hi,

Check whether lr_ent is bound. Also the attribute name is STREET and not STRUCT.STREET.Add this code,


If lr_ent is bound.

  lr_ent->get_property_as_value( ... ).

endif.

Regards,

Arun

Former Member
0 Kudos

Hi Arun,

lr_ent is not bound.

Regards,

Brahmaji

former_member192716
Contributor
0 Kudos

Hi,

BuilAddress entity will be empty if the Addresses tab in web ui is empty. Enter a country and then save the business partner and BuilAddressRel will be bound.

Regards,

Arun

Former Member
0 Kudos

Hi Arun,

Thanks for ur help, it worked for 'BuilStandardAddressRel'.

Please tell the steps to find the iv_relation_name.

Regards,

Brahmaji

former_member192716
Contributor
0 Kudos

Hi,

Go to GENIL_MODEL_BROWSER and the component set for business partners is BP_APPL. You can get the component set from the Model in the runtime repository of the component BP_HEAD or BP_ADDR. Expand the root node 'BuilHeader' and check the relations, you can see all the related entities.

Regards,

Arun