cancel
Showing results for 
Search instead for 
Did you mean: 

Edit table data in WDA

Former Member
0 Kudos

Hi

I'm new in Web Dynpro for Abap and I want to show in a table some things that I have in the context, I already have done this, but I want also to make the table editable, so when I change a field inside the table I want to keep the changes. How can I do this, I don't want to use a form, I just want to make the changes inside the same table. The context is linked to a sap table. Can someone know how to do this?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Isaac Melendez,

As per my knowledge, we dont have that dynamic process in webdynpro.

whenever you change your field in the table then similarly you have to change in the context/form, so that it will work, else you can get missmaching error.

Regards,

Naresh.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

I had solve my doubt. Thanks to all

Regards

Isaac

Former Member
0 Kudos

HI Isaac

I am facing the same problem could you pls help me.

Regards

shabeeb

Former Member
0 Kudos

Hi Shabeeb

Sure, but what is your problem exactly?

Regards,

Isaac

Former Member
0 Kudos

First issue is I have a table in which multiple selection of row is possible, I would like the receive the data of all the selected records in the program.

Where to write code ( which method) will get fired when a row/ rowsin a table is selected

Is there any special function like supply function

Former Member
0 Kudos

Hi Shabeeb,

About how can you receive the data of the selected rows you can use the the method GET_SELECTED_ROWS, here is another post that can help you ([Click here|;). The event that is fired when you select a row is the onSelect in the Table Events. Hope this helps.

Regards,

Isaac.

Former Member
0 Kudos

HI Isaac

How to code the onSelect event event of table and also the GET_SELECTED_ROWS could you please eleborate it for me. May I have some sample code for the about two aspects.

former_member515618
Active Participant
0 Kudos

Hi Shabeeb,

I assume that you are using Table UI element and not ALV display of the data.

Table UI elements have events like OnLeadselcted or Onselection. These are triggered when user selects any of the records in the table. Every time user selects a record one of the events are triggered.

Please note that we cannot use both the events on a table simultaneously.

So the point here is, if you want to get the selected records, then OnLeadselection or OnSelection is not the right place. Each time user selects a records the piece of code to get the selected records is triggered.

Just before you want to process the table data in your logic, do the following to get the selected records.

Assume that 'flight_list' is the name of the node bound to the table.


  DATA lo_nd_flight_list    TYPE REF TO if_wd_context_node.
  DATA lo_el_flight_list    TYPE REF TO if_wd_context_element.
  DATA ls_flight_list       TYPE wd_this->element_flight_list.
  DATA lt_flight_list       TYPE TABLE OF wd_this->element_flight_list.
  DATA lt_selected_elements TYPE wdr_context_element_set.

* navigate from <CONTEXT> to <FLIGHT_LIST> via lead selection
  lo_nd_flight_list = wd_context->get_child_node( name = wd_this->wdctx_flight_list ).
* @TODO handle not set lead selection
  IF lo_nd_flight_list IS INITIAL.
    EXIT.
  ENDIF.

  CALL METHOD lo_nd_flight_list->get_selected_elements
    EXPORTING
      including_lead_selection = abap_true
    RECEIVING
      set                      = lt_selected_elements.

  LOOP AT lt_selected_elements INTO lo_el_flight_list.
* get all declared attributes
    lo_el_flight_list->get_static_attributes(
      IMPORTING
        static_attributes = ls_flight_list ).

    APPEND ls_flight_list TO lt_flight_list.
    CLEAR ls_flight_list.
  ENDLOOP.

lt_flight_list now holds the selected records.

Even if it an ALV display we can still follow the above process to get the selected records.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

Thank you very much Sravan

This code helped me to solve the issue, if you can help me to do coding for OnLeadselcted and Onselection I require it.

Do you have any material regarding this

With Thanks

shabeeb

thomas_szcs
Active Contributor
0 Kudos

Hi Isaac,

I presume you currently have a TextView as a table cell editor in each of the columns. The easiest way to make your table editable is to replace the TextView by an InputField.

Best regards,

Thomas

Former Member
0 Kudos

hi issac....

consider node a is bound to teh table...

so when the table gets loaded initially..

read the values of node a to node b...

now if you make changes in the table, node a gets affected..

but node b remains the same....

so you can make use ofboth the values.

-


regards,

alex b justin