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

Re: How to Restrict the node level in account hierarchy

$
0
0

Hi ,

 

The component is bp_hier, and method is onnew_node.

IF lv_tree->is_locked( ) = abap_false.

     lv_tree->lock( ).

   ENDIF.

   CHECK lv_tree->is_locked( ) = abap_true.

 

 

   lv_index = typed_context->accounthierarchy->selected_index.

   lv_tree_node = typed_context->accounthierarchy->get_node_by_index( lv_index ).

*key = lv_tree_node->node_key.

 

  CALL METHOD lv_api->get_node_parent

     EXPORTING

       iv_node_key        = key

     IMPORTING

       ev_parent_node_key = lv_paent_key

*      ev_tree_guid       =

       .

 

 

 

*   lv_parent = lv_tree_node->parent_entity.

*    typed_context->accounthierarchy->parent_entity.

 

CALL METHOD lv_tree_node->get_children

   receiving

     rt_children = rt_child.

     .

   CHECK lv_tree_node IS BOUND.

   lv_tree_node->is_leaf = abap_false.

 

   TRY.

       lv_proxy_node ?= lv_tree_node.

       TRY.

           lv_object ?= lv_proxy_node->bo.

         CATCH cx_sy_move_cast_error.

           lv_mixed_node ?= lv_proxy_node->bo.

           lv_object ?= lv_mixed_node->if_bsp_wd_ext_property_access~get_model_node( ).

       ENDTRY.

       lv_object_name = lv_object->get_name( ).

       IF lv_object_name = 'BuilHierarchyNode'.

         lv_relation_name = 'BuilHNodeRel'.

       ELSEIF lv_object_name = 'BuilHierarchyHeader'.

         lv_relation_name = 'BuilHeaderNodeRel'.

       ELSE.

         RETURN.

       ENDIF.

 

       lv_tree_node->get_children( ).

       lv_object = lv_object->create_related_entity( lv_relation_name ).

       lv_child_node = lv_proxy_node->node_factory->get_proxy(

           iv_bo = lv_object

           iv_proxy_type = 'CL_BP_HIER_HIERARCHYTREEV_CN05'

           iv_parent_proxy = lv_tree_node ).

 

       lv_tree_node->expand_node( ).

       typed_context->accounthierarchy->refresh( ).

       typed_context->accounthierarchy->deselect_all( ).

       lv_child_node->selected = abap_true.

       lv_child_node->is_leaf  = abap_true.

*accounthierarchy

*      selectedhierarchynode

       lv_col_wrap = typed_context->selectedhierarchynode->get_collection_wrapper( ).

       lv_col_wrap->clear( ).


This is the code.


i wrote . but its not getting.


Viewing all articles
Browse latest Browse all 7775

Trending Articles



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