Professional Documents
Culture Documents
.
*
*
*
method ONACTIONADD .
DATA lo_nd_ekbe1 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe1 TYPE REF TO if_wd_context_element.
DATA ls_ekbe1 TYPE wd_this->Element_ekbe1.
*
.
*
*
*
*
*
*
endmethod.
method ONACTIONDESELECT .
*First identiufy the number of elements a node has.
*So that we can loop those many times.
DATA lo_nd_ekbe1 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe1 TYPE REF TO if_wd_context_element.
DATA ls_ekbe1 TYPE wd_this->Element_ekbe1.
* navigate from <CONTEXT> to <EKBE1> via lead selection
lo_nd_ekbe1 = wd_context->get_child_node( name = wd_this->wdctx_ekbe1 ).
data lv_count type i.
lv_count = LO_ND_EKBE1->GET_ELEMENT_COUNT( ).
data lv_bool type abap_bool.
do lv_count times.
CALL METHOD LO_ND_EKBE1->IS_SELECTED
EXPORTING
INDEX = sy-index
RECEIVING
FLAG
= lv_bool
.
if lv_bool = abap_true.
CALL METHOD LO_ND_EKBE1->SET_SELECTED
EXPORTING
FLAG
= ABAP_false
INDEX = sy-index
.
endif.
enddo.
endmethod.
method ONACTIONREFRESH .
DATA lo_nd_ekbe2 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe2 TYPE REF TO if_wd_context_element.
DATA ls_ekbe2 TYPE wd_this->Element_ekbe2.
*
.
endmethod.
method ONACTIONREMOVE_MUL .
*First identify how many records are selected in the node
*1. Get the node reference
DATA lo_nd_ekbe2 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe2 TYPE REF TO if_wd_context_element.
DATA ls_ekbe2 TYPE wd_this->Element_ekbe2.
*
.
*2 Using the node reference call the method GET_SELECTED_ELEMENTS
DATA LT_ELEMENTS TYPE TABLE OF REF TO IF_WD_CONTEXT_ELEMENT.
DATA WA TYPE REF TO IF_WD_CONTEXT_ELEMENT.
CALL METHOD lo_nd_ekbe2->GET_SELECTED_ELEMENTS
EXPORTING
INCLUDING_LEAD_SELECTION = ABAP_true
RECEIVING
SET
= lt_elements
.
LOOP AT LT_ELEMENTS INTO WA.
lo_nd_ekbe2->REMOVE_ELEMENT( WA ).
ENDLOOP.
endmethod.
method ONACTIONSELECT_ALL .
*First identiufy the number of elements a node has.
*So that we can loop those many times.
DATA lo_nd_ekbe1 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe1 TYPE REF TO if_wd_context_element.
DATA ls_ekbe1 TYPE wd_this->Element_ekbe1.
* navigate from <CONTEXT> to <EKBE1> via lead selection
lo_nd_ekbe1 = wd_context->get_child_node( name = wd_this->wdctx_ekbe1 ).
data lv_count type i.
lv_count = LO_ND_EKBE1->GET_ELEMENT_COUNT( ).
do lv_count times.
CALL METHOD LO_ND_EKBE1->SET_SELECTED
EXPORTING
*
FLAG
= ABAP_TRUE
INDEX = sy-index
.
enddo.
endmethod.
method ONACTIONREFRESH .
DATA lo_nd_ekbe2 TYPE REF TO if_wd_context_node.
*
endmethod.
method POPULATE_DATA_VBAK .
* General Notes
* =============
* A common scenario for a supply method is to aquire key
* informations from the parameter <parent_element> and then
* to invoke a data provider.
* A free navigation thru the context, especially to nodes on
* the same or deeper hierachical level is strongly discouraged,
* because such a strategy may easily lead to unresolvable
* situations!!
*
*
*
*
*
*
** data declaration
method POPULATE_DATA_VBAP .
*
*
*
*
*
*
*
*
*
General Notes
=============
A common scenario for a supply method is to aquire key
informations from the parameter <parent_element> and then
to invoke a data provider.
A free navigation thru the context, especially to nodes on
the same or deeper hierachical level is strongly discouraged,
because such a strategy may easily lead to unresolvable
situations!!
.
*
*
*
*
@TODO fill attribute
*
lv_count1 = 1.
CALL METHOD NODE->GET_ELEMENT_COUNT
RECEIVING
COUNT = lv_count1
.
set single attribute
lo_el_count->set_attribute(
name = `COUNT1`
value = lv_count1 ).
endmethod.
endmethod.
---------------method ONACTIONADD_MULT .
DATA lo_nd_ekbe1 TYPE REF TO if_wd_context_node.
DATA lo_el_ekbe1 TYPE REF TO if_wd_context_element.
DATA ls_ekbe1 TYPE wd_this->Element_ekbe1.
DATA lo_nd_ekbe2 TYPE REF TO if_wd_context_node.
DATA ls_ekbe2 TYPE wd_this->Element_ekbe2.
DATA lt_ekbe2 TYPE wd_this->Elements_ekbe2.
DATA lt_elements type TABLE OF REF TO if_wd_context_element.
DATA wa type REF TO if_wd_context_element.
* navigate from <CONTEXT> to <EKBE1> via lead selection
lo_nd_ekbe1 = wd_context->get_child_node( name = wd_this->wdctx_ekbe1 ).
* navigate from <CONTEXT> to <EKBE2> via lead selection
lo_nd_ekbe2 = wd_context->get_child_node( name = wd_this->wdctx_ekbe2 ).
CALL METHOD LO_ND_EKBE1->GET_SELECTED_ELEMENTS
EXPORTING
INCLUDING_LEAD_SELECTION = ABAP_FALSE
RECEIVING
SET
= lt_elements
.
LOOP AT lt_elements into wa.
*
lo_el_ekbe1->get_static_attributes(
*
IMPORTING
*
static_attributes = ls_ekbe1 ).
CALL METHOD WA->GET_STATIC_ATTRIBUTES
IMPORTING
STATIC_ATTRIBUTES = LS_EKBE1
.
APPEND ls_ekbe1 TO lt_ekbe2.
ENDLOOP.
* @TODO compute values
* e.g. call a model function
*
lo_nd_ekbe2->bind_table( new_items = lt_ekbe2 set_initial_elements = abap_false ).
endmethod.
----------------------------------------------------------------------