Skip to Content
author's profile photo Former Member
Former Member

field handling....

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 27, 2010 at 06:51 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.