cancel
Showing results for 
Search instead for 
Did you mean: 

field handling....

Former Member
0 Kudos

Hi,

i have already my WD Program running.

On the ui i have a table (not ALV)

With in this table there are two columns (easy)

I added a button to add a row an delete (it Works)

This table is initial.

if a user add's a row in the first column (number) there has to be a "1"

another row -> "2" and so on...

this is my code....

DATA: lref_nd_zutaten TYPE REF TO if_wd_context_node.

DATA: lt_zutaten_text TYPE /lungh/ap_lsa_loc_art_zutat.

DATA: lr_element TYPE REF TO if_wd_context_element

, lt_element TYPE wdr_context_element_set

, lv_index TYPE sy-index

. "#EC NEEDED

lt_zutaten_text = wd_comp_controller->giref_model->gis_lokart-maktm_zutaten.

lref_nd_zutaten = wd_context->get_child_node( name = wd_this->wdctx_zutaten ).

lr_element = lref_nd_zutaten->create_element( ).

lref_nd_zutaten->bind_element( new_item = lr_element set_initial_elements = abap_false ).

lref_nd_zutaten->set_lead_selection( lr_element ).

wd_comp_controller->giref_model->set_zutaten_text( it_zutaten_text = lt_zutaten_text ).

**********************

When and where do i the manipulating of the field?

And if you could gimme a example for the coding....

Thanks

Moon

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Implement the onAction event for the 'Add' button and place the following code in the event handler method

DATA: lref_nd_zutaten TYPE REF TO if_wd_context_node.

lref_nd_zutaten = wd_context->get_child_node( name = wd_this->wdctx_zutaten ).
lref_nd_zutaten->get_static_attributes_table( importing table = lt_data ) " lt_data is your internal table of type node.

data: l_total_lines type i.
describe table lt_data lines l_total_lines.
add 1 to l_total_lines.

ls_data-number = l_total_lines.
append ls_data to lt_data.

lref_nd_zutaten->bind_table( lt_data ).

Regards,

Radhika.