Skip to Content
0
Former Member
Apr 23, 2013 at 01:57 PM

Not able to read updated values using 'get_related_entities'

255 Views

Hi Friends

I have a drop down field say 'Status1' on the WebUI screen along with a normal field say 'Status'.

When we are selecting a status value from the drop down field it should be copied to the other (normal field) field 'Status'.

This is working sometimes and not working sometimes, that means whenever we create a new transaction and save and then try to change the status by selecting the value from the drop down then the value is not getting copied however if we reset the session and come back to this screen then it is working.

I have debugged the code and found that in the method 'ON_NEW_FOCUS' we have the following code...

DATA: lv_collection TYPE REF TO if_bol_bo_col,
entity TYPE REF TO cl_crm_bol_entity.

* get collection of dependent nodes

entity ?= focus_bo.

TRY.

lv_collection = entity->get_related_entities(
iv_relation_name = 'PDPStatusRel' ).

CATCH cx_crm_genil_model_error.
* should never happen
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
me->collection_wrapper->set_collection( lv_collection ).

We have ideally two types of status i.e., 1. Created and other is 'Released'.

When we select the 'Released' status from the drop down field then it should be copied to the other field called 'Status'.

If we check the above code 'lv_collection' sometime getting one entity which is having the status 'Created' and sometimes 2 entries with both the status.

When this is having two entries then we are able to set the status 'Released' but it is not always having this entry.

Can you guide me why the relation 'PDPStatusRel' is not haivng the updated values ? is this a memory issue ?

Thank you.