<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DATA_CHANGED event handler is not triggered after error. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385995#M1643353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It should trigger again, despite no changes have been made since the last time.&lt;/P&gt;&lt;P&gt;I suggest you to take a look at the standard demo program &lt;STRONG&gt;BCALV_EDIT_04&lt;/STRONG&gt; and try to adapt your code following that sample.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Nov 2011 17:25:30 GMT</pubDate>
    <dc:creator>former_member209703</dc:creator>
    <dc:date>2011-11-24T17:25:30Z</dc:date>
    <item>
      <title>DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385994#M1643352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;    My program is using the function 'REUSE_ALV_GRID_DISPLAY_LVC' to having the &lt;/P&gt;&lt;P&gt;cells as editable. When  u2018ENTERu2019 is pushed the event DATA_CHANGED is triggered doing the checkings. &lt;/P&gt;&lt;P&gt;The program checks a particular cell to see if it is empty. If it is then an error is displayed in a popup window using  er_data_changed-&amp;amp;gt;add_protocal_entry.&lt;/P&gt;&lt;P&gt;The problem is when the pop up message window is closed and u2018ENTERu2019 is pushed again (cell is still empty) the DATA_CHANGED is not triggered.  &lt;/P&gt;&lt;P&gt;If a cell with a value has an error the event is triggered no matter how many times the u2018ENTERu2019 is pushed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There anyone has any ideas on this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;/Rena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 15:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385994#M1643352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-24T15:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385995#M1643353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It should trigger again, despite no changes have been made since the last time.&lt;/P&gt;&lt;P&gt;I suggest you to take a look at the standard demo program &lt;STRONG&gt;BCALV_EDIT_04&lt;/STRONG&gt; and try to adapt your code following that sample.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 17:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385995#M1643353</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-11-24T17:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385996#M1643354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;    I check the program BCALV_EDIT_03 instead of &lt;U&gt;04 which I bellieve that is more relevant because it  has the event MC&lt;/U&gt;EVT_ENTER and I couldn't find any solution to my problem.&lt;/P&gt;&lt;P&gt;The check_changed_data event is declared in TOP_OF_PAGE as the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;/Rena&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****************************************************************************************&lt;/P&gt;&lt;P&gt;if ref1 is initial.&lt;/P&gt;&lt;P&gt;    call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        e_grid = ref1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method ref1-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    create object g_event_receiver.&lt;/P&gt;&lt;P&gt;    set handler g_event_receiver-&amp;gt;handle_data_changed for ref1.&lt;/P&gt;&lt;P&gt;    call method cl_gui_cfw=&amp;gt;dispatch.&lt;/P&gt;&lt;P&gt;    call method ref1-&amp;gt;check_changed_data&lt;/P&gt;&lt;P&gt;        importing e_valid = l_valid.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Refresh if there is no error&lt;/P&gt;&lt;P&gt;    if not ref1 is initial.&lt;/P&gt;&lt;P&gt;      call method ref1-&amp;gt;check_changed_data&lt;/P&gt;&lt;P&gt;            importing e_valid = l_valid.&lt;/P&gt;&lt;P&gt;      call method cl_gui_cfw=&amp;gt;dispatch.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_stable-row = 'X'.&lt;/P&gt;&lt;P&gt;    ls_stable-col = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method ref1-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        is_stable = ls_stable&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        finished  = 1&lt;/P&gt;&lt;P&gt;        others    = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0. endif.&lt;/P&gt;&lt;P&gt;    call method cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="88" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2011 12:53:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385996#M1643354</guid>
      <dc:creator>eleni_kontoyanni</dc:creator>
      <dc:date>2011-11-25T12:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385997#M1643355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;The key is in the code of the HANDLE_DATA_CHANGED event handler. As long as you give the corresponding error (adding a new entry to the protocol entry when the field has no value), the event will fired every time you press INTRO, despite you're not changing the actual value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_data_changed.
*
    DATA: ls_good TYPE lvc_s_modi,
          l_price TYPE s_price,
          ls_new TYPE lvc_s_moce.

    error_in_data = space.

    LOOP AT er_data_changed-&amp;gt;mt_good_cells INTO ls_good.
      IF ls_good-value. IS INITIAL.  &amp;lt;=== If the field you're checking is empty, throw the error. (This is the key part)
        CALL METHOD er_data_changed-&amp;gt;add_protocol_entry
          EXPORTING
            i_msgid     = '0K'
            i_msgno     = '000'
            i_msgty     = 'E'
            i_msgv1     = 'JOSE'
            i_fieldname = ls_good-fieldname
            i_row_id    = ls_good-row_id.

      ENDIF.
    ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 09:48:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385997#M1643355</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-12-01T09:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385998#M1643356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;  the problem is that the HANDLE_DATA_CHANGED  event handler isn't triggered by ENTER so the code &lt;/P&gt;&lt;P&gt;that you have  proposed me wiil not be implemented.  Do you think that my problem hasn't a solution ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day&lt;/P&gt;&lt;P&gt;/Rena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 10:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385998#M1643356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-02T10:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385999#M1643357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it does have a solution, in fact, I was testing it by modifying the standard demo program BCALV_EDIT_04 and it works as expected.&lt;/P&gt;&lt;P&gt;I'll try to paste the code over here:&lt;/P&gt;&lt;P&gt;Basically what I'm trying to show is that if you reset the value of SEATSMAX the system throws an error and the HANDLE_DATA_CHANGED is fired every time, however if you type a value that is not zero, after the first change and not having added the protocol entry that event is not fired anymore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROGRAM zbcalv_edit_04.

DATA: ok_code LIKE sy-ucomm,
      save_ok LIKE sy-ucomm,
      g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
      g_grid  TYPE REF TO cl_gui_alv_grid,
      g_custom_container TYPE REF TO cl_gui_custom_container,
      gt_fieldcat TYPE lvc_t_fcat,
      gs_layout TYPE lvc_s_layo,
      g_max TYPE i VALUE 100,
      gs_spfli TYPE spfli,                                  "#EC NEEDED
      g_success TYPE c.

*local class to handle semantic checks
CLASS lcl_event_receiver DEFINITION DEFERRED.

DATA: g_verifier TYPE REF TO lcl_event_receiver.

DATA: BEGIN OF gt_outtab OCCURS 0.     "with header line
        INCLUDE STRUCTURE sflight.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF gt_outtab.

DATA: g_carrid LIKE sflight-carrid,
      g_connid LIKE sflight-connid.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_event_receiver DEFINITION.

  PUBLIC SECTION.

    TYPES: BEGIN OF sflight_key.
    TYPES:   carrid TYPE s_carr_id.
    TYPES:   connid TYPE s_conn_id.
    TYPES:   fldate TYPE s_date.
    TYPES: END OF sflight_key.

    TYPES: sflight_keys TYPE STANDARD TABLE OF sflight_key,
           sflight_table TYPE STANDARD TABLE OF sflight.

    METHODS:
      handle_data_changed
         FOR EVENT data_changed OF cl_gui_alv_grid
             IMPORTING er_data_changed.

    METHODS:
      get_inserted_rows
           EXPORTING
              inserted_rows TYPE sflight_keys.

    METHODS:
      get_deleted_rows
          EXPORTING
              deleted_rows TYPE sflight_table.

    METHODS:
       refresh_delta_tables.

    METHODS: set_table_is_initial.

    METHODS: set_table_is_not_initial.

    METHODS: table_is_initial
                RETURNING value(initial) TYPE char01.


  PRIVATE SECTION.


    DATA: inserted_rows TYPE sflight_keys,
          deleted_rows TYPE STANDARD TABLE OF sflight.
    DATA: error_in_data TYPE c.

    DATA: initial_table TYPE c.


ENDCLASS.                    "lcl_event_receiver DEFINITION

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_data_changed.
*
    DATA: ls_good TYPE lvc_s_modi,
          l_price TYPE s_price,
          l_seatsmax TYPE s_seatsmax,
          ls_new TYPE lvc_s_moce.

    error_in_data = space.

    LOOP AT er_data_changed-&amp;gt;mt_good_cells INTO ls_good.

      IF ls_good-fieldname EQ 'SEATSMAX'.

        CALL METHOD er_data_changed-&amp;gt;get_cell_value
          EXPORTING
            i_row_id    = ls_good-row_id
            i_fieldname = ls_good-fieldname
          IMPORTING
            e_value     = l_seatsmax.

        IF l_seatsmax IS INITIAL.

          CALL METHOD er_data_changed-&amp;gt;add_protocol_entry
            EXPORTING
              i_msgid     = '0K'
              i_msgno     = '000'
              i_msgty     = 'E'
              i_msgv1     = 'My Error'
              i_fieldname = ls_good-fieldname
              i_row_id    = ls_good-row_id.

        ENDIF.

      ENDIF.
    ENDLOOP.

    IF error_in_data = 'X'.
      CALL METHOD er_data_changed-&amp;gt;display_protocol.
    ENDIF.

  ENDMETHOD.                    "handle_data_changed

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  METHOD get_inserted_rows.
    inserted_rows = me-&amp;gt;inserted_rows.
  ENDMETHOD.                    "get_inserted_rows
*------------------------------------------------------

  METHOD get_deleted_rows.
    deleted_rows = me-&amp;gt;deleted_rows.
  ENDMETHOD.                    "get_deleted_rows
*------------------------------------------------------
  METHOD refresh_delta_tables.
    CLEAR me-&amp;gt;inserted_rows[].
    CLEAR me-&amp;gt;deleted_rows[].
  ENDMETHOD.                    "refresh_delta_tables
*------------------------------------------------------
  METHOD set_table_is_initial.
    initial_table = 'X'.
  ENDMETHOD.                    "set_table_is_initial
*------------------------------------------------------
  METHOD set_table_is_not_initial.
    initial_table = space.
  ENDMETHOD.                    "set_table_is_not_initial
*------------------------------------------------------
  METHOD table_is_initial.
    IF initial_table = 'X'.
      initial = 'X'.
    ELSE.
      initial = space.
    ENDIF.
  ENDMETHOD.                    "table_is_initial


ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 11:37:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8385999#M1643357</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-12-02T11:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386000#M1643358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES sflight.

PARAMETERS: p_ds TYPE c AS CHECKBOX.   "delete selection

SELECT-OPTIONS s_carrid FOR sflight-carrid
                            NO INTERVALS NO-EXTENSION DEFAULT 'LH'.
SELECT-OPTIONS s_connid FOR sflight-connid
                           NO INTERVALS NO-EXTENSION DEFAULT '0400'.

START-OF-SELECTION.

  g_carrid = s_carrid-low.
  g_connid = s_connid-low.

* first check airline and connection
  SELECT SINGLE * FROM spfli INTO gs_spfli
                     WHERE carrid = g_carrid
                     AND connid = g_connid.

  IF sy-subrc NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        titel = text-i01
        txt1  = text-i02
        txt2  = text-i03
        txt3  = text-i04
        txt4  = text-i05.
  ELSE.

    IF g_success EQ 'X'.
*      call screen 100.
    ELSE.
      MESSAGE i000(0k) WITH text-i10.
    ENDIF.
  ENDIF.

END-OF-SELECTION.
  PERFORM alv.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.

  DATA ls_fcat TYPE lvc_s_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name = 'SFLIGHT'
    CHANGING
      ct_fieldcat      = pt_fieldcat.

  LOOP AT pt_fieldcat INTO ls_fcat.
    ls_fcat-edit = ''.
    IF    ls_fcat-fieldname EQ 'PRICE'
       OR ls_fcat-fieldname EQ 'PLANETYPE'
       OR ls_fcat-fieldname EQ 'FLDATE'.
      ls_fcat-checktable = '!'.        "do not check foreign keys
      MODIFY pt_fieldcat FROM ls_fcat.
    ELSEIF ls_fcat-fieldname = 'CARRID'
       OR ls_fcat-fieldname = 'CONNID'
       OR ls_fcat-fieldname = 'CURRENCY'.
      ls_fcat-auto_value = 'X'.
      ls_fcat-checktable = '!'.   "do not check foreign key relations
    ELSEIF ls_fcat-fieldname EQ 'SEATSMAX'.
      ls_fcat-edit = 'X'.
    ENDIF.
    MODIFY pt_fieldcat FROM ls_fcat.

  ENDLOOP.

ENDFORM.                    "build_fieldcat

FORM select_data CHANGING pt_outtab LIKE gt_outtab[].
  DATA: lt_sflight TYPE TABLE OF sflight,
        ls_sflight TYPE sflight,
        ls_outtab LIKE LINE OF gt_outtab,
        l_index TYPE i,
        ls_spfli TYPE spfli,                                "#EC NEEDED
        lt_celltab TYPE lvc_t_styl.

  IF p_ds IS INITIAL.
    SELECT * FROM sflight INTO TABLE lt_sflight UP TO g_max ROWS
                     WHERE carrid = g_carrid
                       AND connid = g_connid.
  ENDIF.

  IF sy-subrc NE 0 OR NOT p_ds IS INITIAL.
    ls_outtab-carrid = g_carrid.
    ls_outtab-connid = g_connid.
    CASE g_carrid.
      WHEN 'LH'.
        ls_outtab-currency = 'DEM'.
      WHEN OTHERS.
        ls_outtab-currency = 'US'.
    ENDCASE.
    ls_outtab-seatsocc = 0.
    ls_outtab-paymentsum = 0.

    PERFORM fill_celltab USING 'RW'
                         CHANGING lt_celltab.
    INSERT LINES OF lt_celltab INTO TABLE ls_outtab-celltab.
    APPEND ls_outtab TO pt_outtab.

    CALL METHOD g_verifier-&amp;gt;set_table_is_initial.
  ELSE.
    CALL METHOD g_verifier-&amp;gt;set_table_is_not_initial.
    LOOP AT lt_sflight INTO ls_sflight.
      MOVE-CORRESPONDING ls_sflight TO ls_outtab.
      APPEND ls_outtab TO pt_outtab.
    ENDLOOP.

    LOOP AT pt_outtab INTO ls_outtab.
      l_index = sy-tabix.
      REFRESH lt_celltab.
      PERFORM fill_celltab USING 'RO'
                        CHANGING lt_celltab.

      INSERT LINES OF lt_celltab INTO TABLE ls_outtab-celltab.
      MODIFY pt_outtab FROM ls_outtab INDEX l_index.
    ENDLOOP.
  ENDIF.

ENDFORM.                               " select_data
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 11:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386000#M1643358</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-12-02T11:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386001#M1643359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM alv .
  DATA: lt_exclude TYPE ui_functions.
  DATA: g_repid TYPE syrepid.
  DATA: lt_evts      TYPE slis_t_event.
  g_repid = sy-repid.
  CREATE OBJECT g_verifier.
  PERFORM select_data CHANGING gt_outtab[].
  PERFORM build_fieldcat CHANGING gt_fieldcat.
  gs_layout-stylefname = 'CELLTAB'.
  PERFORM f01_set_evts CHANGING lt_evts.
  gs_layout-edit = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_callback_program = g_repid
      is_layout_lvc      = gs_layout
      it_fieldcat_lvc    = gt_fieldcat
      it_events          = lt_evts
    TABLES
      t_outtab           = gt_outtab[]
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.

ENDFORM.                    " ALV

FORM f01_set_evts CHANGING ct_events TYPE slis_t_event.

 FIELD-SYMBOLS: &amp;lt;ls_event&amp;gt; TYPE slis_alv_event.
  DATA: l_event  TYPE lvc_fname.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 4
    IMPORTING
      et_events       = ct_events
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.

  READ TABLE ct_events ASSIGNING &amp;lt;ls_event&amp;gt;
             WITH KEY name = 'CALLER_EXIT'.
  IF sy-subrc EQ 0.
    CONCATENATE 'F01_ALV_EVENT_'
                &amp;lt;ls_event&amp;gt;-name
                INTO &amp;lt;ls_event&amp;gt;-form.
  ENDIF.
ENDFORM.                    " f01_set_evts
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM f01_set_evts CHANGING ct_events TYPE slis_t_event.

 FIELD-SYMBOLS: &amp;lt;ls_event&amp;gt; TYPE slis_alv_event.
  DATA: l_event  TYPE lvc_fname.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 4
    IMPORTING
      et_events       = ct_events
    EXCEPTIONS
      list_type_wrong = 1
      OTHERS          = 2.

  READ TABLE ct_events ASSIGNING &amp;lt;ls_event&amp;gt;
             WITH KEY name = 'CALLER_EXIT'.
  IF sy-subrc EQ 0.
    CONCATENATE 'F01_ALV_EVENT_'
                &amp;lt;ls_event&amp;gt;-name
                INTO &amp;lt;ls_event&amp;gt;-form.
  ENDIF.
ENDFORM.                    " f01_set_evts
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM f01_alv_event_caller_exit USING cs_data TYPE slis_data_caller_exit.
                                                            "#EC *


  DATA: ref1 TYPE REF TO cl_gui_alv_grid,
        ls_layo_lvc TYPE lvc_s_layo.

  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = ref1.

  CHECK ref1 IS BOUND.
* Set editable cells to ready for input initially
  CALL METHOD ref1-&amp;gt;set_ready_for_input
    EXPORTING
      i_ready_for_input = 1.


  CALL METHOD ref1-&amp;gt;register_edit_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.

  CREATE OBJECT g_verifier.
  SET HANDLER g_verifier-&amp;gt;handle_data_changed FOR ref1.


ENDFORM.                    "f01_alv_event_caller_exit
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM fill_celltab USING value(p_mode)
                  CHANGING pt_celltab TYPE lvc_t_styl.
  DATA: ls_celltab TYPE lvc_s_styl,
        l_mode TYPE raw4.
* This forms sets the style of columns 'PRICE', FLDATE and PLANETYPE
* editable

  IF p_mode EQ 'RW'.
    l_mode = cl_gui_alv_grid=&amp;gt;mc_style_enabled.
  ELSE.                                "p_mode eq 'RO'
    l_mode = cl_gui_alv_grid=&amp;gt;mc_style_disabled.
  ENDIF.

  ls_celltab-fieldname = 'FLDATE'.
  ls_celltab-style = l_mode.
  INSERT ls_celltab INTO TABLE pt_celltab.
  ls_celltab-fieldname = 'PRICE'.
  ls_celltab-style = l_mode.
  INSERT ls_celltab INTO TABLE pt_celltab.
  ls_celltab-fieldname = 'PLANETYPE'.
  ls_celltab-style = l_mode.
  INSERT ls_celltab INTO TABLE pt_celltab.

ENDFORM.                               " FILL_CELLTAB

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 11:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386001#M1643359</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-12-02T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386002#M1643360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try registering "ENTER" event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL METHOD &amp;lt;alv_grid&amp;gt;-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 12:03:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386002#M1643360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-02T12:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386003#M1643361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sharin,&lt;/P&gt;&lt;P&gt;   I have already tried this and it didn' work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;/Rena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 12:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386003#M1643361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-02T12:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386004#M1643362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;  Iu2019ve made some modifications in your program and now the problem can be reproduced :&lt;/P&gt;&lt;P&gt;Do the followings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After:&lt;/STRONG&gt;  LOOP AT er_data_changed-&amp;gt;mt_good_cells INTO ls_good.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Insert:&lt;/STRONG&gt;   CALL METHOD er_data_changed-&amp;gt;get_cell_value&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            i_row_id    = ls_good-row_id&lt;/P&gt;&lt;P&gt;            i_fieldname = 'CURRENCY'&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            e_value     = l_CURRENCY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF l_CURRENCY IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CALL METHOD er_data_changed-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;              i_msgid     = '0K'&lt;/P&gt;&lt;P&gt;              i_msgno     = '000'&lt;/P&gt;&lt;P&gt;              i_msgty     = 'E'&lt;/P&gt;&lt;P&gt;              i_msgv1     = 'EMPTY CURRENCY'&lt;/P&gt;&lt;P&gt;              i_fieldname = 'CURRENCY'&lt;/P&gt;&lt;P&gt;              i_row_id    = ls_good-row_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Comment:&lt;/STRONG&gt;      &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF l_seatsmax IS INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         CALL METHOD er_data_changed-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_msgid     = '0K'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_msgno     = '000'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_msgty     = 'E'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_msgv1     = 'My Error'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_fieldname = ls_good-fieldname&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             i_row_id    = ls_good-row_id&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Insert:&lt;/STRONG&gt;     clear ls_outtab-currency.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Before&lt;/STRONG&gt;     &lt;/P&gt;&lt;P&gt; modify pt_outtab from ls_outtab index l_index.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                               " select_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test Instructions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a)&lt;/STRONG&gt; The Currency is empty, change the ID, press ENTER, an error is displayed, press ENTER again, no error.&lt;/P&gt;&lt;P&gt;This is my problem !!!  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;b)&lt;/STRONG&gt; Now, fill the currency with a value, press ENTER, no error, clear the currency, press ENTER, we have an error, if you press again and again the ENTER the error will be displayed every time. &lt;/P&gt;&lt;P&gt;This is what I want in the case a). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;/Rena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 13:28:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-error/m-p/8386004#M1643362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-02T13:28:47Z</dc:date>
    </item>
  </channel>
</rss>

