Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8088

Re: How to Instantiate a Context Node in Web UI

$
0
0

     Please check the below link.

 

http://scn.sap.com/community/crm/webclient-ui-framework/blog/2012/09/25/implementation-of-a-custom-genil-model-in-web-ui

 

 

1.> First Load t he BOL object

 

data : lr_core type ref to cl_crm_bol_core.

try.

  lr_core = cl_crm_bol_core=>get_instance( ).

  lr_core->start_up('BOL object name').   

Catch cx_crm_genil_general_error.

Endtry.

 

2.> Get a root instance or entity factory

 

  DATA : lr_factory             TYPE REF TO cl_crm_bol_entity_factory.

  DATA : lr_entity              TYPE  REF TO cl_crm_bol_entity.

* Create Root Instance in a Collection.   

TRY.

        CALL METHOD gr_core->root_create

          EXPORTING

            iv_object_name  = lc_entity

            iv_create_param = lt_params

            iv_number       = 1

          RECEIVING

            rv_result       = lr_col.

 

* Obtain Factory of Root Object in Entity.

 

     lr_factory = gr_core->get_entity_factory( iv_entity_name = lc_entity ).

 

        lr_entity = lr_factory->create( lt_params ).

 

IF lr_entity IS BOUND.
       e->typed_context->customer->collection_wrapper->add( iv_entity = lr_entity ).
         CHECK lr_entity->lock( ) = abap_true.

 

      CATCH cx_crm_unsupported_object.

 

data : lr_cont type ref to cl_crm_bol_entity.

 

  lr_cust  ?= me->typed_context->customer->collection_wrapper->get_current( ).

 

this is a common way to instantiate a bol object

 

Regards,

Sumeet


Viewing all articles
Browse latest Browse all 8088

Trending Articles



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