on 08-16-2010 7:00 PM
Hello experts,
I am creating a abap web dynpro applicaiton with a table UI element. The requirement is for the cursor to shift to first column on next row when user presses enter. I tried many tricks but am not able to get this thing going.
I tired the code below in WDDOMODIFYVIEW( ) method, on program execution when I enter data for a row on the table and press enter on the last column of the row the focus shifts to first column of the same row. I want this to be set to the first column of the successive row.
data: obj_table type ref to cl_wd_table,
lr_column type ref to cl_wd_table_column,
lr_view_element type ref to if_wd_view_element,
lr_input type ref to cl_wd_input_field.
data: lo_nd_hkont type ref to if_wd_context_node,
lo_dmbtr type ref to if_Wd_context_element,
lo_el_hkont type ref to if_wd_context_element,
lo_act_enabled type abap_bool,
lv_count type i,
lv_index type i.
check first_time eq abap_false.
check if action 'VALIDATE_DMBTR' is triggered.
lo_dmbtr = wd_context->get_element( ).
lo_dmbtr->get_attribute(
exporting
name = 'VALIDATE_DMBTR'
importing
value = lo_act_enabled ).
check lo_act_enabled eq abap_true. " if action triggered
lo_nd_hkont = wd_context->path_get_node( 'PRELIMINARY_POSTING.CHANGING.T_BSEG' ).
lo_el_hkont = lo_nd_hkont->get_element( ).
obj_table ?= view->get_element( 'TABLE' ).
lv_count = obj_table->get_row_count( context_element = lo_el_hkont ).
SET FOCUS TO FIRST COLUMN *****
lr_view_element = view->get_element( 'TABLE_HKONT_EDITOR').
view->request_focus_on_view_elem( exporting view_element = lr_view_element
context_element = lo_el_hkont ).
reset attribute of context node.
lo_dmbtr->set_attribute(
exporting
name = 'VALIDATE_DMBTR'
value = abap_false ).
Issue Resolved
Need to set lead selection to next element in the node using MOVE_NEXT method of IF_WD_CONTEXT_NODE interface.
rest of the code remains same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.