cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Context Mapping in Web Dynpro ABAP

Former Member
0 Kudos

Hi Experts,

How can I create two dynamic Context nodes, one in ViewController and the other in Component Controller and finally create a context mapping between them?

Regards,

Johan Kriek.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Johan,

use this to cretate context node dynamically where it is(view or component).

CL_WD_DYNAMIC_TOOL=>CREATE_NODEINFO_FROM_STRUCT

just pass structure name and root node info to this method.you will have context node with attributes.

Former Member
0 Kudos

Thanks Suman,

How would I then create a context mapping between this node and a node in the view controller?

Regards,

Johan Kriek.

Former Member
0 Kudos

Hi Johan,

I think this is not possible to bind dynamically.I didnt find any methods for this.

Former Member
0 Kudos

Hi Suman,

I found a method IF_WD_CONTEXT_NODE_INFO~ADD_NEW_MAPPED_CHILD_NODE that seems to be the one that I am looking for.

I dont know how to use it however. Any ideas?

Regards,

Johan Kriek,

Former Member
0 Kudos

Hi Johan,

I found a method IF_WD_CONTEXT_NODE_INFO~ADD_NEW_MAPPED_CHILD_NODE that seems to be the one that I am looking for.

I do have same idea but i have been trying to give solution by using above method,unfortunately here my server is down.check the below code. i didnt check this code due to server down.

DATA: lo_nd_purchase_header TYPE REF TO if_wd_context_node,
      lo_el_purchase_header TYPE REF TO if_wd_context_element,
 ls_purchase_header TYPE wd_this->element_purchase_header,
      lo_node_info type ref to if_wd_context_node_info,
      lo_child_node_info type ref to if_wd_context_node_info,
      MAPPING_INFO type WDR_CONTEXT_MAPPING_INFO.

* navigate from <CONTEXT> to <PURCHASE_HEADER> via lead selection
  lo_nd_purchase_header = wd_context->get_child_node( name = wd_this->wdctx_purchase_header ).

              CALL METHOD LO_ND_PURCHSE_HEADER->GET_NODE_INFO
                RECEIVING
                  NODE_INFO = lo_node_info.

       MAPPING_INFO-controller = 'ZWDC_ALV'. "conponent name
       MAPPING_INFO-path = 'PURCHASE_HEADER'. "Controller context node name
       
      CALL METHOD LO_NODE_INFO->ADD_NEW_MAPPED_CHILD_NODE
        EXPORTING
          CHILD_NAME      = 'PURCHASE_HEADER'
          MAPPING_INFO    =  MAPPING_INFO 
*          IS_STATIC       = ABAP_TRUE
        RECEIVING
          CHILD_NODE_INFO = lo_child_node_info
          .

Answers (0)