<?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: select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905699#M377537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT i_mch1 IS INITIAL.
SELECT 
b~matnr "Material Number.
b~meins "Basic unit of measure.
a~werks "Plant.
a~lgort "Storage location.
a~charg "Batch number.
a~clabs "Unrestricted.
a~cinsm "Quality Inspection.
a~cspem "Blocked
FROM mara AS b INNER JOIN mchb AS a
ON b~matnr EQ a~matnr
INTO TABLE i_mchb_mara
FOR ALL ENTRIES IN i_mch1
WHERE b~matnr EQ i_mch1-matnr AND
b~werks EQ p_werks AND
b~charg IN s_charg AND
b~lgort IN ( c_0001, c_0002 ).

IF sy-subrc &amp;lt;&amp;gt; 0.
MESSAGE e000(8i) WITH text-003.
ELSE.
MESSAGE e000(8i) WITH text-004.
ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ue Mara inner join mchb.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Feb 2007 07:00:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-08T07:00:51Z</dc:date>
    <item>
      <title>select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905697#M377535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The select statement is not fetching data, i have a doubt whether ( ON a&lt;SUB&gt;matnr EQ b&lt;/SUB&gt;matnr) i am making inner join on mchb and mara should the data be common in both tables so that it gets data, i have commented from for all entries but even its not fetching the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF i_mch1 IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT a~matnr                                  "Material Number.&lt;/P&gt;&lt;P&gt;           a~werks                                  "Plant.&lt;/P&gt;&lt;P&gt;           a~lgort                                  "Storage location.&lt;/P&gt;&lt;P&gt;           a~charg                                  "Batch number.&lt;/P&gt;&lt;P&gt;           a~clabs                                  "Unrestricted.&lt;/P&gt;&lt;P&gt;           a~cinsm                                  "Quality Inspection.&lt;/P&gt;&lt;P&gt;           a~cspem                                  "Blocked&lt;/P&gt;&lt;P&gt;           b~meins                                  "Basic unit of measure.&lt;/P&gt;&lt;P&gt;           FROM mchb AS a INNER JOIN mara AS b&lt;/P&gt;&lt;P&gt;           ON a&lt;SUB&gt;matnr EQ b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;           INTO TABLE i_mchb_mara&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN i_mch1&lt;/P&gt;&lt;P&gt;           WHERE a~matnr EQ i_mch1-matnr AND&lt;/P&gt;&lt;P&gt;                 a~werks EQ p_werks AND&lt;/P&gt;&lt;P&gt;                 a~charg IN s_charg AND&lt;/P&gt;&lt;P&gt;                 a~lgort IN (c_0001, c_0002).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e000(8i) WITH text-003.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      MESSAGE e000(8i) WITH text-004.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 06:58:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905697#M377535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T06:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905698#M377536</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;Is p_werks mandatory in the selection-screen...Otherwise the select statement will look for blank values in those tables..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 06:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905698#M377536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T06:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905699#M377537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT i_mch1 IS INITIAL.
SELECT 
b~matnr "Material Number.
b~meins "Basic unit of measure.
a~werks "Plant.
a~lgort "Storage location.
a~charg "Batch number.
a~clabs "Unrestricted.
a~cinsm "Quality Inspection.
a~cspem "Blocked
FROM mara AS b INNER JOIN mchb AS a
ON b~matnr EQ a~matnr
INTO TABLE i_mchb_mara
FOR ALL ENTRIES IN i_mch1
WHERE b~matnr EQ i_mch1-matnr AND
b~werks EQ p_werks AND
b~charg IN s_charg AND
b~lgort IN ( c_0001, c_0002 ).

IF sy-subrc &amp;lt;&amp;gt; 0.
MESSAGE e000(8i) WITH text-003.
ELSE.
MESSAGE e000(8i) WITH text-004.
ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ue Mara inner join mchb.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905699#M377537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905700#M377538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Couple of things. First change your IF statement to IF i_mch1[] IS NOT INITIAL. This will make it check if the internal table has any records. In your current statement you are only checking if the header work area is initial or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next make sure that your internal table has the material number and the batch numbers in internal format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905700#M377538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905701#M377539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the values are given in selection screen, even i have comented from for all entries the data is not fetching up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905701#M377539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905702#M377540</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;As mentioned by Srinivas Adavi..make sure the material number is internal format..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the tables MCHB and MARA if there is any record exists..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905702#M377540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905703#M377541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;other than that, nothing else should effect unless there is no data in MCHB for your given selection criteria.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905703#M377541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905704#M377542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if mara-matnr and mchb-matnr data is not equal will the select statement gets failed eg: ON a&lt;SUB&gt;matnr EQ b&lt;/SUB&gt;matnr - from this inner join is happening i have checked in both the tables the values are different is this the problem,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:25:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905704#M377542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905705#M377543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;S obviously it wont fetch any data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can fetch data only when both the table key field values are same, using joins.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 07:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905705#M377543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T07:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905706#M377544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But that cannot be true. If you have a batch then the material has to exist in MARA. There may be some materials for which you may not have any batches, but all batch materials should be there in MARA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 21:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1905706#M377544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T21:20:41Z</dc:date>
    </item>
  </channel>
</rss>

