Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 15, 2008 at 11:57 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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
                .