<?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 Help to display error message in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768919#M906928</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone, here is my code, I need help where there are question marks : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  SELECT * INTO CORRESPONDING FIELDS OF TABLE t_table2    &lt;/P&gt;&lt;P&gt;         FROM ztmm_fourho.                                &lt;/P&gt;&lt;P&gt;IF ??????                                                         &lt;/P&gt;&lt;P&gt;  SELECT belnr hkont shkzg mwskz wrbtr FROM bseg         &lt;/P&gt;&lt;P&gt;   INTO CORRESPONDING FIELDS OF TABLE t_table1&lt;/P&gt;&lt;P&gt;   FOR ALL ENTRIES IN t_table2&lt;/P&gt;&lt;P&gt;   WHERE hkont = t_table2-zaccnt AND&lt;/P&gt;&lt;P&gt;         gjahr = p_year AND&lt;/P&gt;&lt;P&gt;         bukrs = p_comp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE. ????&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the following : t_table2 is a table with 2 columns both containing a char type. I would like to perform the "SELECT" only if for at least one line contained in t_table2 both columns ARE filled, meaning that I would like to display an error message (in the "else" condition) if for some lines, only the first column contains some information. In the code above, ztmm_fourho is a custom database table previously filled in through transaction code SM30; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help would be much appreciated and rewarded, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2008 11:42:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-05T11:42:20Z</dc:date>
    <item>
      <title>Help to display error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768919#M906928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone, here is my code, I need help where there are question marks : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  SELECT * INTO CORRESPONDING FIELDS OF TABLE t_table2    &lt;/P&gt;&lt;P&gt;         FROM ztmm_fourho.                                &lt;/P&gt;&lt;P&gt;IF ??????                                                         &lt;/P&gt;&lt;P&gt;  SELECT belnr hkont shkzg mwskz wrbtr FROM bseg         &lt;/P&gt;&lt;P&gt;   INTO CORRESPONDING FIELDS OF TABLE t_table1&lt;/P&gt;&lt;P&gt;   FOR ALL ENTRIES IN t_table2&lt;/P&gt;&lt;P&gt;   WHERE hkont = t_table2-zaccnt AND&lt;/P&gt;&lt;P&gt;         gjahr = p_year AND&lt;/P&gt;&lt;P&gt;         bukrs = p_comp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE. ????&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is the following : t_table2 is a table with 2 columns both containing a char type. I would like to perform the "SELECT" only if for at least one line contained in t_table2 both columns ARE filled, meaning that I would like to display an error message (in the "else" condition) if for some lines, only the first column contains some information. In the code above, ztmm_fourho is a custom database table previously filled in through transaction code SM30; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help would be much appreciated and rewarded, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 11:42:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768919#M906928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T11:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help to display error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768920#M906929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; if sy-dbcnt &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;Then...&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagrds,&lt;/P&gt;&lt;P&gt;Shiva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 11:47:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768920#M906929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T11:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help to display error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768921#M906930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SELECT * INTO CORRESPONDING FIELDS OF TABLE t_table2 &lt;/P&gt;&lt;P&gt;FROM ztmm_fourho. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   loop at t_table2.&lt;/P&gt;&lt;P&gt;      if t_table2-field2 is initial.&lt;/P&gt;&lt;P&gt;        v_flag = 'X'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v_flag is initial. &lt;/P&gt;&lt;P&gt;SELECT belnr hkont shkzg mwskz wrbtr FROM bseg &lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE t_table1&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_table2&lt;/P&gt;&lt;P&gt;WHERE hkont = t_table2-zaccnt AND&lt;/P&gt;&lt;P&gt;gjahr = p_year AND&lt;/P&gt;&lt;P&gt;bukrs = p_comp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;*error message .. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 11:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-to-display-error-message/m-p/3768921#M906930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T11:51:45Z</dc:date>
    </item>
  </channel>
</rss>

