Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamic Context Mapping in Web Dynpro ABAP

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.

Former Member
Former Member replied

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
          .

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question