cancel
Showing results for 
Search instead for 
Did you mean: 

Edit a Empty Table

danilo_cardoso
Participant
0 Kudos

Hi experts!

I am developing a web dynpro app that must to work similarly a table control, but i have a problem.

I created a button to insert new entries and when this button is clicked i need to clear my table data and open the columns to insert new data, but, I don't found a way to open the columns when my table is empty, when it has data, no problem, i set the properties READ_ONLY and that's it! But when my table is empty the columns doesn't open even I set the READ_ONLY property.

Anyone already seen it before?

Thx and advance.

Danilo

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Why not simply add a new empty line?

you can add also a new attribute to your node called "new_line" in order to check something... or bind to the property read_only for some colums...

danilo_cardoso
Participant
0 Kudos

Hi.

Thanks for your answer.

How do I insert an empty and new line?

I already bind the property read_only to my columns, but, some of them are DropDownByIndex and these is not changing.

Regards and thanks again.

Danilo

Former Member
0 Kudos

insert an empty new line is easy, all you have to do is read the entire table, add the new line and then set the entire table to the context...

something like that;

DATA lo_nd_my_table TYPE REF TO if_wd_context_node.
  DATA ls_my_table TYPE wd_this->element_my_table.
  DATA lt_my_table TYPE wd_this->elements_my_table.

* navigate from <CONTEXT> to <my_table> via lead selection
  lo_nd_my_table = wd_context->get_child_node( name = wd_this->wdctx_my_table ).
  lo_nd_my_table->get_static_attributes_table( IMPORTING table = lt_my_table ).

* Append a new line
  APPEND ls_my_table TO lt_my_table.
  lo_nd_my_table->bind_table( new_items = lt_my_table set_initial_elements = abap_false ).

for DropDownByIndex columns i don't know, i never use it...