Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: Not able to read updated values using 'get_related_entities'

$
0
0

Hi Pratheek

 

The flow is as follows :

 

We have method 'CREATE_STATUS' in the _CTXT class and it has the following code..

 

    owner->do_context_node_binding(

            iv_controller_type = cl_bsp_wd_controller=>co_type_custom

            iv_name =

 

            '/CFCRMX2/CM_PDPCMP/CuCoPDP'                     "#EC NOTEXT

 

            iv_target_node_name = 'STATUS'

            iv_node_2_bind = status ).

 

DATA lr_node TYPE REF TO cl_crm_bol_entity.

   lr_node ?= pdp->collection_wrapper->get_current( ).

   status->set_pdp_node( lr_node ).

 

* initial setting for depandant model node

   coll_wrapper =

     pdp->get_collection_wrapper( ).

   TRY.

       entity ?= coll_wrapper->get_current( ).

     CATCH cx_sy_move_cast_error.

   ENDTRY.

 

 

   IF entity IS BOUND.

     status->on_new_focus(

                  focus_bo = entity ).

   ENDIF.

 

so from here it will call ON_NEW_FOCUS method and this method has the following code...

 

parent_entity ?= focus_bo.

 

* get collection of dependent nodes

   TRY.

       lv_collection = parent_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 ).

 

Here, 'lv_collection'  will have all the entities sometimes and not all the times.

I mean to say whenever we select the status 'Released' from drop down it should have two entries one for the status 'Created' and another for 'Released' however sometimes it is having one entry which is for 'Created' and sometimes it is having both the entries( Created & Released).

 

if you see the below method 'GET_TXT30' we have the code as follows

Status.JPG

CALL METHOD cl_mkt_cpgmpl_util=>get_status_text

     EXPORTING

       ir_status_coll = collection_wrapper

     RECEIVING

       rv_status      = value.

 

This 'Collection_wrapper' is not getting both the status all the times and hence the result is wrong but whenever it gets the both the entries( Created & Released ) then the result is correct.

 

So i guess something wrong with the method 'set_collection' of ON_NEW_FOCUS method.

 

Pl let me know if you are not clear still. Thank you.

 

Regards

 



Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>