Skip to Content
0
Former Member
Jun 05, 2009 at 04:04 PM

Populate a field on TAB press in ALV Grid (OOPs)

601 Views

Hi Experts,

I have an ALV(oops) with cl_gui_alv_grid. I have a field MATNR as empty and when i input a value and i press TAB key d anit should go to next field (next coulmn) to fill the old material# which can be got from MARA.

I am not able to get the sy-ucomm or e_ucomm for TAB press.

Q) WHERE should i write my query logic to fill the OLD MAtnr field.

code sample : I have data change event as below.

class lcl_event_handler definition

PUBLIC SECTION .

METHODS:

changed_data for event data_changed of cl_gui_alv_grid importing er_data_changed

e_ucomm sender,

ENDCLASS.

in Implemntation class...

CLASS LCL_EVENT_HANDLER IMPLEMENTATION.

METHOD changed_data.

clear: ls_stable-row, ls_stable-col.

loop at er_data_changed->mt_mod_cells into ls_modified.

clear wa_outdisp.

READ TABLE gt_outdisp INTO wa_outdisp INDEX ls_modified-row_id.

CHECK sy-subrc EQ 0.

lv_field = ls_modified-fieldname.

if lv_field = 'MATNR'.

wa_outdisp-MATNR = ls_modified-value.

wa_outdisp-bismt = '123'.

endif.

MODIFY gt_outdisp FROM wa_outdisp INDEX ls_modified-row_id.

ls_stable-row = 'X'.

ls_stable-col = 'X'.

grid->refresh_table_display( exporting is_stable = ls_stable ).

endloop.

ENDMETHOD. "changed_data

ENDCLASS.

How can i do this?

Thanks

Dan