<?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 Sum into Variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638892#M607402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i'm trying to make a sum from an user defined table, and retrieve this value into a variable, the problem is when don't satisfy the conditions (where), the variable sy-subrc never goes to 4, i need to know when the select retrieves me a value and where is not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT SUM( cant )&lt;/P&gt;&lt;P&gt;    FROM zcmtt_envase&lt;/P&gt;&lt;P&gt;      INTO v_cant&lt;/P&gt;&lt;P&gt; WHERE docsap = p_tipo&lt;/P&gt;&lt;P&gt;       AND ref    = p_ti_zcmtt_envase-ref&lt;/P&gt;&lt;P&gt;       AND matnr  = ti_sumlips-matnr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;sy-subr it's always 0 !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2007 17:42:40 GMT</pubDate>
    <dc:creator>sergio_cifuentes</dc:creator>
    <dc:date>2007-08-08T17:42:40Z</dc:date>
    <item>
      <title>Sum into Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638892#M607402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i'm trying to make a sum from an user defined table, and retrieve this value into a variable, the problem is when don't satisfy the conditions (where), the variable sy-subrc never goes to 4, i need to know when the select retrieves me a value and where is not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT SUM( cant )&lt;/P&gt;&lt;P&gt;    FROM zcmtt_envase&lt;/P&gt;&lt;P&gt;      INTO v_cant&lt;/P&gt;&lt;P&gt; WHERE docsap = p_tipo&lt;/P&gt;&lt;P&gt;       AND ref    = p_ti_zcmtt_envase-ref&lt;/P&gt;&lt;P&gt;       AND matnr  = ti_sumlips-matnr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;sy-subr it's always 0 !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 17:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638892#M607402</guid>
      <dc:creator>sergio_cifuentes</dc:creator>
      <dc:date>2007-08-08T17:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum into Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638893#M607403</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 value of variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_cant is not initial. " means sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;else. &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;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 17:47:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638893#M607403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T17:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sum into Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638894#M607404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes that's what i'm doing right now, but what i mean is why sy-subrc doesn't change??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 17:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-into-variable/m-p/2638894#M607404</guid>
      <dc:creator>sergio_cifuentes</dc:creator>
      <dc:date>2007-08-08T17:56:48Z</dc:date>
    </item>
  </channel>
</rss>

