Skip to Content
avatar image
Former Member

Read Complete internal table from Context...

How can I read the complete node with cardinality 1..N into an internal table with same ddic structure as the node ????

when uses the DYNPRO WIZARD, it is saying both types are not compatible...

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 21, 2008 at 08:23 AM

    Hi Stephan,

    You can make use of the GET_STATIC_ATTRIBUTES_TABLE method of IF_WD_CONTEXT_NODE to download the contents of your entire context of cardinality 1..n into an internal table of the same structure. Refer the example coding as shown below.

    Regards,

    Uday

    DATA: node_node_flighttab TYPE REF TO if_wd_context_node,
          lt_sflight TYPE if_resultview=>elements_node_flighttab.
    
    
    node_node_flighttab = wd_context->get_child_node( name = `NODE_FLIGHTTAB` ).
    node_node_flighttab->get_static_attributes_table( IMPORTING table = lt_sflight ).

    Now lt_sflight will contain all the data which is bound to the context node NODE_FLIGHTTAB.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 21, 2008 at 08:21 AM

    Hi,

    Please try to use the GET_NODE_INFO method of the IF_WD_CONTEXT_NODE that returns the IF_WD_CONTEXT_NODE_INFO and based on the ref try to retrieve the child nodes, attrtibutes names etc and populate the internal table using this information.

    Regards

    Lekha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 21, 2008 at 08:42 AM

    Hi,

    Lets say your node name is TEST with cardinality 1...n.

    declare data in a method where you want to read the context as

    DATA lo_nd_TEST TYPE REF TO if_wd_context_node..

    DATA:

    ls_TEST TYPE wd_this>element_TEST,

    it_TEST TYPE wd_this->elements_TEST.

    • navigate from <CONTEXT> to <EMP_POPU_TAB> via lead selection

    lo_nd_TEST = wd_context->get_child_node( name = wd_this->wdctx_TEST ).

    lo_nd_TEST->get_static_attributes_table( IMPORTING table = it_TEST ).

    in the internal table it_TEST you will get the entire context node values.

    Regards,

    Subhasis

    Add comment
    10|10000 characters needed characters exceeded