cancel
Showing results for 
Search instead for 
Did you mean: 

Question about context node filling

matteo_montalto
Contributor
0 Kudos

Hi all gurus; I'm struggling over a simple task, hope that someone could help .

Shortly: I defined a data structure as follows:

DATA: BEGIN OF ls_struct,

     vendor   TYPE bbp_bp_orga,

     cptable  TYPE zebp_contpers_t, "this is a Table Type!

         END OF ls_struct,

         lt_struct LIKE TABLE OF ls_struct.

So, there's a table lt_struct with a line that is build up by:

- a "flat" field;

- an internal table (made up by some fields).

I need to TRANSPORT these information from one view to another using a common Context Node shared via ComponentController.

I then tried to create such a node in the Context but there's something I must have done wrong:

Here's my sketch:

CP_FOR_BIDDERS has no Dictionary structure; here's the subnode CPTABLE:


I tried then to store the values in these nodes in my methods:

IF lt_struct IS NOT INITIAL.

     DATA lo_nd_cp_for_bidders TYPE REF TO if_wd_context_node..

     lo_nd_cp_for_bidders = wd_context->get_child_node( name = wd_this->wdctx_cp_for_bidders ).

     CALL METHOD lo_nd_cp_for_bidders->bind_table

       EXPORTING

         new_items            = lt_struct

*        set_initial_elements = ABAP_TRUE

*        index                =

         .

However, if I try then to GET the values from the node, I can see only VENDOR values, while the associated internal table is always blank.
What am I missing?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Matteo,

You also want to bind the CPTABLE node for each CP_FOR_BIDDERS element. One example is below; you can also loop through the table of elements for node CP_FOR_BIDDERS, fetch each element's CPTABLE node and bind the CPTABLE data to each CPTABLE node.

    lo_nd_cptable = wd_context->path_get_node( path = `CP_FOR_BIDDERS.CPTABLE` ).

    CALL METHOD lo_nd_cptable>bind_table(

        new_items               = lt_cptable_data

        set_initial_elements = abap_true

    ).

Cheers,

Amy

matteo_montalto
Contributor
0 Kudos

Hi Amy,

Solved... using the standard tools. I did as follows:

instead of creating dynamically the structures, I created a DDIC Zstructure and then created a node giving it my Ztype and "importing attributes from structure".

That did the trick

Thanks again

Answers (0)