<?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 input.(OO ALV) 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-input-oo-alv/m-p/6087709#M1358067</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
  METHOD HANDLE_DATA_CHANGED.                               "#EC NEEDED

*&amp;lt;&amp;lt;&amp;lt;  BEGIN MODIFY EXAMPLE CODE
*   u4FDDu5B58u30C7u30FCu30BFu3092u7DE8u96C6u3059u308Bu3000START
    DATA: LW_INS      TYPE LVC_S_MOCE,
          LV_FNAME    TYPE LVC_FNAME,
          LW_MOD      TYPE LVC_S_MODI,
          LV_MAX      TYPE I,
          LV_RES(12)  TYPE C,
          LW_LIST     TYPE ZTSRE012,
          LV_ROWID    TYPE LVC_S_ROID,
          LT_MOD      TYPE LVC_T_MODI,
          LV_COLID    TYPE LVC_S_COL,

          LV_ROW_ID    TYPE LVC_S_ROW,
          LV_COL_ID    TYPE LVC_S_COL.

*   u73FEu5728u306Eu30D5u30A9u30FCu30ABu30B9u4F4Du7F6Eu3092u53D6u5F97
    CALL METHOD GO_ALV_GRID7-&amp;gt;GET_CURRENT_CELL
      IMPORTING
        ES_ROW_ID = LV_ROW_ID
        ES_COL_ID = LV_COL_ID.

    LOOP AT GT_LIST INTO LW_LIST.
      IF LW_LIST-ID &amp;gt; LV_MAX.
        LV_MAX = LW_LIST-ID.
      ENDIF.
    ENDLOOP.
*   u30B0u30EBu30FCu30D7ID
    LV_FNAME = CNS_ID.
    LOOP AT ER_DATA_CHANGED-&amp;gt;MT_INSERTED_ROWS INTO LW_INS.
      LV_MAX = LV_MAX + 1.
      CALL METHOD ER_DATA_CHANGED-&amp;gt;MODIFY_CELL
        EXPORTING
          I_ROW_ID    = LW_INS-ROW_ID
          I_FIELDNAME = LV_FNAME
          I_VALUE     = LV_MAX.
    ENDLOOP.
    CLEAR: LV_FNAME.

    LT_MOD[] = ER_DATA_CHANGED-&amp;gt;MT_GOOD_CELLS[].

*   u30C7u30FCu30BFu30C1u30A7u30C3u30AF
    LOOP AT LT_MOD INTO LW_MOD.
      IF LW_MOD-FIELDNAME = CNS_ZZTTSN.

        LV_COLID-FIELDNAME = LW_MOD-FIELDNAME.
        LV_ROWID-ROW_ID    = LW_MOD-ROW_ID.

        CALL METHOD GO_ALV_GRID7-&amp;gt;SET_CURRENT_CELL_VIA_ID
          EXPORTING
            IS_COLUMN_ID = LV_COLID
            IS_ROW_NO    = LV_ROWID.

        CALL METHOD GO_ALV_GRID7-&amp;gt;GET_CURRENT_CELL
          IMPORTING
            E_VALUE = LV_RES.

        IF LV_RES IS INITIAL.

          CALL METHOD ER_DATA_CHANGED-&amp;gt;ADD_PROTOCOL_ENTRY
            EXPORTING
              I_MSGID     = CNS_MSGID
              I_MSGTY     = CNS_MSGTY
              I_MSGNO     = CNS_MSGNO
              I_FIELDNAME = LW_MOD-FIELDNAME
              I_ROW_ID    = LW_MOD-ROW_ID.
        ENDIF.
        CALL METHOD ER_DATA_CHANGED-&amp;gt;MODIFY_CELL
          EXPORTING
            I_ROW_ID    = LW_MOD-ROW_ID
            I_FIELDNAME = LW_MOD-FIELDNAME
            I_VALUE     = LV_RES.
       ENDIF.
      CLEAR:  LV_RES,
              LV_COLID,
              LV_ROWID.
    ENDLOOP.

    CALL METHOD GO_ALV_GRID7-&amp;gt;SET_CURRENT_CELL_VIA_ID
      EXPORTING
        IS_ROW_ID    = LV_ROW_ID
        IS_COLUMN_ID = LV_COL_ID.


  ENDMETHOD.                    "handle_data_changed
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Changjiu Tan on Sep 7, 2009 1:31 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Changjiu Tan on Sep 7, 2009 1:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Sep 2009 11:34:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-07T11:34:32Z</dc:date>
    <item>
      <title>DATA_CHANGED event handler is not triggered after input.(OO ALV)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-input-oo-alv/m-p/6087708#M1358066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I register Enter as the trigger event for data_changed event, and I put my checking logic in data_changed_handler which is a method of a local class. When the checking fails, I put messages using er_data_changed-&amp;gt;add_protocal_entry to show messages.&lt;/P&gt;&lt;P&gt;My checking is simple, if the cell is empty, error messages pops up tells that this cell can not be blank for this row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When there is no entry in the alv list(Only this situation), I insert a new entry, the cell which is required is empty, I press Enter, data_changed event is triggered, the message pops up saying that the cell is required. Then close the pop up message window, I input something in the cell, and press enter. The data_changed event is not triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any1 has any ideas on this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vicnent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Changjiu Tan on Sep 7, 2009 1:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-input-oo-alv/m-p/6087708#M1358066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: DATA_CHANGED event handler is not triggered after input.(OO ALV)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-input-oo-alv/m-p/6087709#M1358067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
  METHOD HANDLE_DATA_CHANGED.                               "#EC NEEDED

*&amp;lt;&amp;lt;&amp;lt;  BEGIN MODIFY EXAMPLE CODE
*   u4FDDu5B58u30C7u30FCu30BFu3092u7DE8u96C6u3059u308Bu3000START
    DATA: LW_INS      TYPE LVC_S_MOCE,
          LV_FNAME    TYPE LVC_FNAME,
          LW_MOD      TYPE LVC_S_MODI,
          LV_MAX      TYPE I,
          LV_RES(12)  TYPE C,
          LW_LIST     TYPE ZTSRE012,
          LV_ROWID    TYPE LVC_S_ROID,
          LT_MOD      TYPE LVC_T_MODI,
          LV_COLID    TYPE LVC_S_COL,

          LV_ROW_ID    TYPE LVC_S_ROW,
          LV_COL_ID    TYPE LVC_S_COL.

*   u73FEu5728u306Eu30D5u30A9u30FCu30ABu30B9u4F4Du7F6Eu3092u53D6u5F97
    CALL METHOD GO_ALV_GRID7-&amp;gt;GET_CURRENT_CELL
      IMPORTING
        ES_ROW_ID = LV_ROW_ID
        ES_COL_ID = LV_COL_ID.

    LOOP AT GT_LIST INTO LW_LIST.
      IF LW_LIST-ID &amp;gt; LV_MAX.
        LV_MAX = LW_LIST-ID.
      ENDIF.
    ENDLOOP.
*   u30B0u30EBu30FCu30D7ID
    LV_FNAME = CNS_ID.
    LOOP AT ER_DATA_CHANGED-&amp;gt;MT_INSERTED_ROWS INTO LW_INS.
      LV_MAX = LV_MAX + 1.
      CALL METHOD ER_DATA_CHANGED-&amp;gt;MODIFY_CELL
        EXPORTING
          I_ROW_ID    = LW_INS-ROW_ID
          I_FIELDNAME = LV_FNAME
          I_VALUE     = LV_MAX.
    ENDLOOP.
    CLEAR: LV_FNAME.

    LT_MOD[] = ER_DATA_CHANGED-&amp;gt;MT_GOOD_CELLS[].

*   u30C7u30FCu30BFu30C1u30A7u30C3u30AF
    LOOP AT LT_MOD INTO LW_MOD.
      IF LW_MOD-FIELDNAME = CNS_ZZTTSN.

        LV_COLID-FIELDNAME = LW_MOD-FIELDNAME.
        LV_ROWID-ROW_ID    = LW_MOD-ROW_ID.

        CALL METHOD GO_ALV_GRID7-&amp;gt;SET_CURRENT_CELL_VIA_ID
          EXPORTING
            IS_COLUMN_ID = LV_COLID
            IS_ROW_NO    = LV_ROWID.

        CALL METHOD GO_ALV_GRID7-&amp;gt;GET_CURRENT_CELL
          IMPORTING
            E_VALUE = LV_RES.

        IF LV_RES IS INITIAL.

          CALL METHOD ER_DATA_CHANGED-&amp;gt;ADD_PROTOCOL_ENTRY
            EXPORTING
              I_MSGID     = CNS_MSGID
              I_MSGTY     = CNS_MSGTY
              I_MSGNO     = CNS_MSGNO
              I_FIELDNAME = LW_MOD-FIELDNAME
              I_ROW_ID    = LW_MOD-ROW_ID.
        ENDIF.
        CALL METHOD ER_DATA_CHANGED-&amp;gt;MODIFY_CELL
          EXPORTING
            I_ROW_ID    = LW_MOD-ROW_ID
            I_FIELDNAME = LW_MOD-FIELDNAME
            I_VALUE     = LV_RES.
       ENDIF.
      CLEAR:  LV_RES,
              LV_COLID,
              LV_ROWID.
    ENDLOOP.

    CALL METHOD GO_ALV_GRID7-&amp;gt;SET_CURRENT_CELL_VIA_ID
      EXPORTING
        IS_ROW_ID    = LV_ROW_ID
        IS_COLUMN_ID = LV_COL_ID.


  ENDMETHOD.                    "handle_data_changed
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Changjiu Tan on Sep 7, 2009 1:31 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Changjiu Tan on Sep 7, 2009 1:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:34:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-changed-event-handler-is-not-triggered-after-input-oo-alv/m-p/6087709#M1358067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:34:32Z</dc:date>
    </item>
  </channel>
</rss>

