SAP Move Cursor to next Row automatically after Pressing Enter in OOP ALV



Introduction:

Do you think.. if is it possible to have the same functionality of the Excel: Press Enter and cursor will move to next row in ALV ??

Steps

  • Register the ALV Edit event (mc_evt_enter) for enter
This will enable ALV event trigger option when press enter.
CALL METHOD g_grid->register_edit_event
  EXPORTING    i_event_id cl_gui_alv_grid=>mc_evt_enter
  • Event listener method for Edit Event
Event Handler create object g_event_receiver.
SET HANDLER g_event_receiver-handle_data_changed FOR g_grid.
  • In Side the ''handle_data_changed" put in following code
DATA: lv_row TYPE i,
lv_value TYPE c,
lv_col TYPE i,
lv_row_id TYPE lvc_s_row,
lv_col_id TYPE lvc_s_col,
lv_row_no TYPE lvc_s_roid.

//Getting Current Cell
CALL METHOD g_grid->get_current_cell
IMPORTING
e_row = lv_row
e_value = lv_value
e_col = lv_col
es_row_id = lv_row_id
es_col_id = lv_col_id
es_row_no = lv_row_no.

//Total number of tables
DESCRIBE TABLE gt_outtab LINES sy-index.

//Getting next row
lv_row_id-index = lv_row_id-index + 1.
lv_row_no-row_id = lv_row_no-row_id + 1.

//Set the Next row
IF lv_row_id-index LE sy-index.
CALL METHOD g_grid->set_current_cell_via_id
EXPORTING
is_row_id = lv_row_id
is_column_id = lv_col_id
is_row_no = lv_row_no.
ENDIF.

Previous
Next Post »
1 Komentar
avatar

Gratis Casinos & Casinos - Mapyro
Find the best Gratis casinos in 제주도 출장샵 Lotoosa, 의왕 출장샵 CA, United States. This map is for the most 경기도 출장마사지 recent 사천 출장안마 Gratis online 강릉 출장샵 casino opening in 2020.

Balas