<?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 Validating alvgrid from an external method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320243#M165144</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 first post in the forum:-). i am an ABAP amateur and currently working on alvgrids.&lt;/P&gt;&lt;P&gt;My problem is that i need to validate an alvgrid from an external method i.e. using the cl_alv_changed_data_protocol because my handle_data_changed doesnt get triggered for certain changes in the grid(the grid is just made that way..complex requirement!).&lt;/P&gt;&lt;P&gt;i am posting the code of the validation method below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD validate_str_qualifs.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;        ls_out       TYPE /mrss/t_sqp_estr_out,&lt;/P&gt;&lt;P&gt;        lt_str       TYPE /mrss/t_sqp_estr_tab,&lt;/P&gt;&lt;P&gt;        ls_prof_data LIKE LINE OF gt_prof_data,&lt;/P&gt;&lt;P&gt;        lref_str_err TYPE REF TO cl_alv_changed_data_protocol,&lt;/P&gt;&lt;P&gt;        ls_str       TYPE /mrss/d_sqp_estr,&lt;/P&gt;&lt;P&gt;        lv_count     TYPE i,&lt;/P&gt;&lt;P&gt;        lt_str_fcat  TYPE lvc_t_fcat,&lt;/P&gt;&lt;P&gt;        lt_roid_front TYPE lvc_t_roid,&lt;/P&gt;&lt;P&gt;        ls_roid_front LIKE LINE OF lt_roid_front,&lt;/P&gt;&lt;P&gt;        lv_rows        TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_str_err&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_calling_alv = gref_alv_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD me-&amp;gt;get_str_fcat&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      et_str_fcat = lt_str_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lref_str_err-&amp;gt;mt_fieldcatalog = lt_str_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read structured quals from global employee data.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE gt_prof_data INDEX 1 INTO ls_prof_data.&lt;/P&gt;&lt;P&gt;  lt_str = ls_prof_data-str_qual-emp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_count = 0.&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE lt_str LINES lv_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHILE lv_count NE lv_rows.&lt;/P&gt;&lt;P&gt;    lv_count = lv_count + 1.&lt;/P&gt;&lt;P&gt;    ls_roid_front-row_id = lv_count.&lt;/P&gt;&lt;P&gt;    append ls_roid_front to lt_roid_front.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign the rows table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lref_str_err-&amp;gt;mt_roid_front = lt_roid_front.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_count = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;loop at the structured qualifications&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT lt_str INTO ls_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lv_count = lv_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*   check if primary qualification is initial&lt;/P&gt;&lt;P&gt;    IF ls_str-pri_qualif IS INITIAL.&lt;/P&gt;&lt;P&gt;      ev_invalid = 'X'.&lt;/P&gt;&lt;P&gt;      CALL METHOD lref_str_err-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_msgid = '/MRSS/SQU'&lt;/P&gt;&lt;P&gt;        i_msgno = '008'&lt;/P&gt;&lt;P&gt;        i_msgty = 'E'&lt;/P&gt;&lt;P&gt;        i_fieldname = 'POSID_P_TEXT'&lt;/P&gt;&lt;P&gt;        i_row_id = lv_count.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  check for ratings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF ls_str-rating IS INITIAL.&lt;/P&gt;&lt;P&gt;      ev_invalid = 'X'.&lt;/P&gt;&lt;P&gt;      CALL METHOD lref_str_err-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;     i_msgid = '/MRSS/SQU'&lt;/P&gt;&lt;P&gt;     i_msgno = '009'&lt;/P&gt;&lt;P&gt;     i_msgty = 'E'&lt;/P&gt;&lt;P&gt;     i_fieldname = 'RATING_TEXT'&lt;/P&gt;&lt;P&gt;     i_row_id = lv_count.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF ev_invalid = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  show the protocol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD lref_str_err-&amp;gt;display_protocol.&lt;/P&gt;&lt;P&gt;  ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD me-&amp;gt;update_str_outtab.&lt;/P&gt;&lt;P&gt;  CALL METHOD gref_alv_str-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the validations happen as i want them to and the protocol is also displayed, &amp;lt;b&amp;gt;but the erroneous cells in my grid dont get highlighted (red).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any words of wisdom from the ABAP gurus?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 May 2006 13:52:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-31T13:52:44Z</dc:date>
    <item>
      <title>Validating alvgrid from an external method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320243#M165144</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 first post in the forum:-). i am an ABAP amateur and currently working on alvgrids.&lt;/P&gt;&lt;P&gt;My problem is that i need to validate an alvgrid from an external method i.e. using the cl_alv_changed_data_protocol because my handle_data_changed doesnt get triggered for certain changes in the grid(the grid is just made that way..complex requirement!).&lt;/P&gt;&lt;P&gt;i am posting the code of the validation method below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD validate_str_qualifs.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;        ls_out       TYPE /mrss/t_sqp_estr_out,&lt;/P&gt;&lt;P&gt;        lt_str       TYPE /mrss/t_sqp_estr_tab,&lt;/P&gt;&lt;P&gt;        ls_prof_data LIKE LINE OF gt_prof_data,&lt;/P&gt;&lt;P&gt;        lref_str_err TYPE REF TO cl_alv_changed_data_protocol,&lt;/P&gt;&lt;P&gt;        ls_str       TYPE /mrss/d_sqp_estr,&lt;/P&gt;&lt;P&gt;        lv_count     TYPE i,&lt;/P&gt;&lt;P&gt;        lt_str_fcat  TYPE lvc_t_fcat,&lt;/P&gt;&lt;P&gt;        lt_roid_front TYPE lvc_t_roid,&lt;/P&gt;&lt;P&gt;        ls_roid_front LIKE LINE OF lt_roid_front,&lt;/P&gt;&lt;P&gt;        lv_rows        TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT lref_str_err&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_calling_alv = gref_alv_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD me-&amp;gt;get_str_fcat&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      et_str_fcat = lt_str_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lref_str_err-&amp;gt;mt_fieldcatalog = lt_str_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read structured quals from global employee data.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  READ TABLE gt_prof_data INDEX 1 INTO ls_prof_data.&lt;/P&gt;&lt;P&gt;  lt_str = ls_prof_data-str_qual-emp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_count = 0.&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE lt_str LINES lv_rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHILE lv_count NE lv_rows.&lt;/P&gt;&lt;P&gt;    lv_count = lv_count + 1.&lt;/P&gt;&lt;P&gt;    ls_roid_front-row_id = lv_count.&lt;/P&gt;&lt;P&gt;    append ls_roid_front to lt_roid_front.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;assign the rows table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lref_str_err-&amp;gt;mt_roid_front = lt_roid_front.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_count = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;loop at the structured qualifications&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT lt_str INTO ls_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lv_count = lv_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*   check if primary qualification is initial&lt;/P&gt;&lt;P&gt;    IF ls_str-pri_qualif IS INITIAL.&lt;/P&gt;&lt;P&gt;      ev_invalid = 'X'.&lt;/P&gt;&lt;P&gt;      CALL METHOD lref_str_err-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_msgid = '/MRSS/SQU'&lt;/P&gt;&lt;P&gt;        i_msgno = '008'&lt;/P&gt;&lt;P&gt;        i_msgty = 'E'&lt;/P&gt;&lt;P&gt;        i_fieldname = 'POSID_P_TEXT'&lt;/P&gt;&lt;P&gt;        i_row_id = lv_count.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  check for ratings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF ls_str-rating IS INITIAL.&lt;/P&gt;&lt;P&gt;      ev_invalid = 'X'.&lt;/P&gt;&lt;P&gt;      CALL METHOD lref_str_err-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;     i_msgid = '/MRSS/SQU'&lt;/P&gt;&lt;P&gt;     i_msgno = '009'&lt;/P&gt;&lt;P&gt;     i_msgty = 'E'&lt;/P&gt;&lt;P&gt;     i_fieldname = 'RATING_TEXT'&lt;/P&gt;&lt;P&gt;     i_row_id = lv_count.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF ev_invalid = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  show the protocol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL METHOD lref_str_err-&amp;gt;display_protocol.&lt;/P&gt;&lt;P&gt;  ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD me-&amp;gt;update_str_outtab.&lt;/P&gt;&lt;P&gt;  CALL METHOD gref_alv_str-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the validations happen as i want them to and the protocol is also displayed, &amp;lt;b&amp;gt;but the erroneous cells in my grid dont get highlighted (red).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any words of wisdom from the ABAP gurus?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2006 13:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320243#M165144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-31T13:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Validating alvgrid from an external method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320244#M165145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi manoj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are certain validation like date, time, currency, quantity , for those automatic error handling takes place. but for others you have to take care.anf for some fields they have check tables in that case you have to use this for that field in fieldcat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ls_fcat-checktable = '!'.&amp;lt;/b&amp;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;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2006 14:03:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320244#M165145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-31T14:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Validating alvgrid from an external method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320245#M165146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;thanks for your reply, but unfortunately that doesnt solve my problem:(. to further clarify the question, currently i am passing the fieldcatalog(mt_fieldcatalog)  and also  the rowid(mt_roid_front). do i need to pass anything else so that the cl_alv_changed_data_protocol class will highlight the cells from which dont have valid data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2006 14:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320245#M165146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-31T14:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Validating alvgrid from an external method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320246#M165147</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;check the Demo &amp;lt;b&amp;gt;BCALV_EDIT_04&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2006 14:44:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320246#M165147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-31T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Validating alvgrid from an external method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320247#M165148</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;in the above example check this method..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; method perform_semantic_checks.
    data: ls_good type lvc_s_modi,
          l_planetype type s_planetye,
          l_seatsmax type s_seatsmax.

    loop at pr_data_changed-&amp;gt;mt_good_cells into ls_good.
      case ls_good-fieldname.
        when 'PLANETYPE'.
          call method pr_data_changed-&amp;gt;get_cell_value
             exporting
               i_row_id = ls_good-row_id
               i_fieldname = ls_good-fieldname
             importing
               e_value = l_planetype.

          select single seatsmax from saplane into l_seatsmax
                        where planetype = l_planetype.

          if sy-subrc ne 0.
            call method pr_data_changed-&amp;gt;add_protocol_entry
                            exporting
                 i_msgid = '0K' i_msgno = '000'  i_msgty = 'E'
                 i_msgv1 = text-m02
                 i_fieldname = ls_good-fieldname
                 i_row_id = ls_good-row_id.

            error_in_data = 'X'.
          else.


            call method pr_data_changed-&amp;gt;modify_cell
              exporting i_row_id    = ls_good-row_id
                        i_fieldname = 'SEATSMAX'
                        i_value     = l_seatsmax.
          endif.
      endcase.
    endloop.
  endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2006 15:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-alvgrid-from-an-external-method/m-p/1320247#M165148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-31T15:35:41Z</dc:date>
    </item>
  </channel>
</rss>

