cancel
Showing results for 
Search instead for 
Did you mean: 

Element is getting initial

Former Member
0 Kudos

Hello,

I am using  Table UI  element.  When i click on Select ALL option of the table  and click on button  , the element  of the node is getting initial after the statement 

lo_el_sample = lo_nd_nd_sample->get_element( ) method.

But where as when iam selecting all the records individually   the element is  not getting initial .  the problem is only with the Select All option of the table.

Please help.

Thanks .

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Suresh,

You can put a check before executing the statement in case you are getting any dump.

IF lo_el_sample IS BOUND.

lo_el_sample = lo_nd_nd_sample->get_element( ).

ENDIF.

You can use the below mentioned code.

DATA : lt_temp TYPE wdr_context_element_set.

DATA : wa_temp TYPE REF TO if_wd_context_element.

lo_nd_nd_sample->get_selected_elements(

RECEIVING set = lt_temp).

LOOP AT lt_temp INTO wa_temp.

CALL METHOD wa_temp->get_static_attributes

IMPORTING

static_attributes = ls_selected_table.

APPEND ls_selected_table TO lt_selected_table.

ENDLOOP.

Former Member
0 Kudos

Hello,

DATA ls_element_set  TYPE REF TO if_wd_context_element.
   DATA lt_element_set  TYPE wdr_context_element_set.

DEMO CODE...

"" Reading of node which is bind with table...

DATA lo_nd_proj_mstr TYPE REF TO if_wd_context_node.
   DATA lt_proj_mstr TYPE wd_this->elements_proj_mstr.
   DATA ls_proj_mstr TYPE wd_this->element_proj_mstr.
   DATA lo_el_proj_mstr TYPE REF TO if_wd_context_element.

    lo_nd_proj_mstr = wd_context->get_child_node( name = wd_this->wdctx_proj_mstr ).
     lo_nd_proj_mstr->get_static_attributes_table( IMPORTING table = lt_proj_mstr ).

Now...
IF lt_proj_mstr[] IS NOT INITIAL.
       lo_nd_proj_mstr->get_selected_elements( RECEIVING set = lt_element_set ).


LOOP AT lt_element_set INTO ls_element_set.
           CALL METHOD ls_element_set->get_static_attributes
             IMPORTING
               static_attributes = ls_proj_data.

"" Here you will receive all selected row into   ls_proj_data.

endloop.


BR

Chandra...

former_member184578
Active Contributor
0 Kudos

Hi,

The code which you wrote works for single selected element. you have to use get_selected_elements method of context node to get the selected rows. Try the below code:

Data: lo_nd_node type ref to if_wd_context_node.

  data: lr_element   type ref to if_wd_context_element,

        lt_selrows  type WDR_CONTEXT_ELEMENT_SET,

        wa_selrows like line of it_selrows.

  lo_nd_node_node = wd_context->get_child_node( name = '<NODE>').

  lt_selrows  = lo_nd_node_node->GET_SELECTED_ELEMENTS( ).

LOOP AT lt_selrows INTO wa_selrows.

    CALL METHOD wa_selrows->get_static_attributes

        IMPORTING

          static_attributes = ls_<Node>.

    append ls_<node> to lt_<data> . " lt_<DATA> is the internal table of Ctxt Node type

    clear ls_<node>.                            " which contains the selected Rows

  ENDLOOP.

Hope this helps u.,

Regards,

Kiran