ABAP 捕获回车键更新值
gt_events1 TYPE slis_t_event.
*&---------------------------------------------------------------------* *& Form EVENT_INTIT1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM event_intit1 . DATA: ls_events TYPE slis_alv_event. ls_events-name = slis_ev_data_changed. ls_events-form = 'FRM_DATA_CHANGED1'. APPEND ls_events TO gt_events1. ENDFORM. " EVENT_INTIT1
*&---------------------------------------------------------------------* *& Form frm_data_changed *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->RR_DATA_CHANGED text *----------------------------------------------------------------------* FORM frm_data_changed1 USING rr_data_changed TYPE REF TO cl_alv_changed_data_protocol. DATA :wa_mod TYPE LINE OF lvc_t_modi. * MOVE rr_data_changed-mt_mod_cells TO wa_mod. DATA:ref_grid TYPE REF TO cl_gui_alv_grid. CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' * EXPORTING * IR_SALV_FULLSCREEN_ADAPTER = IMPORTING * ET_EXCLUDING = * E_REPID = * E_CALLBACK_PROGRAM = * E_CALLBACK_ROUTINE = e_grid = ref_grid. * ET_FIELDCAT_LVC = * ER_TRACE = * E_FLG_NO_HTML = * ES_LAYOUT_KKBLO = * ES_SEL_HIDE = * ET_EVENT_EXIT = * ER_FORM_TOL = * ER_FORM_EOL = LOOP AT rr_data_changed->mt_mod_cells INTO wa_mod . READ TABLE gt_alv1 INDEX wa_mod-row_id. IF sy-subrc EQ 0. gt_alv1-jszoj = wa_mod-value * gt_alv1-bstmg. gt_alv1-shuij = gt_alv1-jszoj * 17 / 100. gt_alv1-yfzhk = gt_alv1-jszoj + gt_alv1-shuij. gt_alv1-yfzcy = gt_alv1-yfzhk - ( gt_alv1-wrbtr * 117 / 100 ). gt_alv1-shjcy = gt_alv1-shuij - ( gt_alv1-wrbtr * 17 / 100 ). gt_alv1-matcy = gt_alv1-yfzcy - gt_alv1-shjcy. MODIFY gt_alv1 FROM gt_alv1 INDEX wa_mod-row_id. ENDIF. ENDLOOP."刷新内表 MODIFY_CELL CALL METHOD ref_grid->refresh_table_display. ENDFORM. "frm_data_changed