2014 Nov 18 4:33 AM
Hi,
I am using g_grid%->check_changed_data. (call method)
after typed the value in editable field ,then press enter ---it checks the condition and throws an error.
CALL METHOD p_er_data_changed->add_protocol_entry am using call method changed_data
how can i use these here.
Hi,
I am using g_grid%->check_changed_data. (call method)
after typed the value in editable field ,then press enter ---it checks the condition and throws an error.
CALL METHOD p_er_data_changed->add_protocol_entry am using call method changed_data
how can i use these here.
2014 Nov 18 4:49 AM
HI
after g_grid%->check_changed_data call method you wil get changed data into your internal table
from that internal table you can put validation
regards
laxman
2014 Nov 18 7:26 AM
Hi anitha
see the piece of code
u can get the changed values in mt_good_cells method there u can loop based on rownid ie TABIX then u can validate ur changed fields.finaly refresh ur grid using refresh_table_display
PUBLIC SECTION .
METHODS:
**Handler to Check the Data Change
handle_data_changed FOR EVENT data_changed
OF cl_gui_alv_grid
IMPORTING er_data_changed
e_onf4
e_onf4_before,
ENDCLASS. "lcl_event_receiver DEFINITION
*---------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.
* **Handle Data Change
METHOD handle_data_changed.
DATA: x_change TYPE lvc_s_modi,
x_final TYPE itab,
l_flag,
ls_outtab LIKE LINE OF itab.
DATA: ls_edit TYPE lvc_s_styl,
lt_edit TYPE lvc_t_styl,
lv_tabix TYPE sy-tabix.
* UNASSIGN :<fs_price>.
* CREATE DATA fs_price LIKE LINE OF <ft_price>.
* ASSIGN fs_price->* TO <fs_price>.
LOOP AT er_data_changed->mt_good_cells INTO x_change.
lv_tabix = x_change-row_id.
READ TABLE gt_final INTO gs_final INDEX lv_tabix.
IF sy-subrc EQ 0.
MODIFY gt_final FROM gs_final INDEX lv_tabix.
ENDIF.
CLEAR : lv_tabix,gs_final.
ENDLOOP.
"logic for refreshing the grid
CALL METHOD o_so_alv->set_frontend_layout
EXPORTING
is_layout = l_layout.
CALL METHOD o_so_alv->refresh_table_display .