cancel
Showing results for 
Search instead for 
Did you mean: 

Selected line in edit mode and default values in a new row..

sreemsft
Contributor
0 Kudos

Hi,

I am using ALV and ALV standard functions to append, delete, insert lines in a table.

Here I have 2 questions

1) When I append a line, I want to default some values in the new line.. How can I do this?

2) I could make the whole table in edit mode using column edit, but I want only one single line in edit mode. The line which is selected, should be in edit mode. How is this possible?

Can anyone suggest me with any sample code?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

yesrajkumar
Active Participant
0 Kudos

Hi Sreekanth,

Please look at the following code, it will be useful.

DATA:

lo_node_raj TYPE REF TO if_wd_context_node,

lo_elem_raj TYPE REF TO if_wd_context_element,

ls_raj TYPE if_componentcontroller=>element_raj .

*ls_raj is just the structure to hold the values

lo_elem_raj = lo_node_raj->create_element( ).

  • wd_this->ms_rajdefault hold the value for the current row that you can get using get_static_attributes method.

MOVE-CORRESPONDING wd_this->ms_rajdefault TO ls_raj.

lo_elem_raj->set_static_attributes( static_attributes = ls_raj ).

lo_node_raj->bind_element( new_item = lo_elem_raj

set_initial_elements = abap_false ).

lo_node_raj->set_lead_selection( lo_elem_raj ).

Thanks,

Rajkumar.S

Answers (0)