on 12-04-2009 12:13 PM
How to copy a selected row into new row with same values.
Thanks
Have you got any button for COPY...If yes, then in this copy button handler,
get the element that is selected..using the GET_SELECTED_ELEMENTS if selection is 1:N
if you have single lead selection then you can use the get_lead_selection that returns the row selected..
Now, get the added row number element instance and using the set_static_attributes you can pass the above record to this method..
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I assume that there is a COPY buttonand there is a single lead seecltion for your alv table.
Now,
data:
lr_node type ref to if_wd_context_node,
lr_element type ref to if_wd_context_element,
lr_element1 type ref to if_wd_context_element,
ls_table type vbak,
ls_table1 type vbak.
lr_node = wd_context->get_chaild_node ( 'FLIGHT ' ).
if lr_node is not initial.
lr_element = lr_node->get_lead_selection ( ).
lr_elemnet1 = lr_node->get_element( index = 4). "supose the index of new row is 4
* you can use the get_element_count to know the record number
endif.
if lr_element is not initial.
lr_element->get_statitc_attributes
importing
static_attributes = ls_table
endif.
if lr_element1 is not initial.
lr_element1->set_staitc_attributes
exporting
STATIC_ATTRIBUTES = ls_table.
endif.
Assume that you have already created a new row...
use code wizard.
Regards,
Lekha.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.