<?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: Sum calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203060#M1203716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your query is ambiguous. Still I am answering as per my understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say you are selecting MENGE from database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you have UCOMM as parameter in selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if ITAB has following values,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;200&lt;/P&gt;&lt;P&gt;300&lt;/P&gt;&lt;P&gt;400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and UCOMM = 20 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;             menge type menge,&lt;/P&gt;&lt;P&gt;             tot(10) type c ,&lt;/P&gt;&lt;P&gt;         end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***already you selcetd data in ITAB&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  itab-tot = itab-menge + p_ucomm.&lt;/P&gt;&lt;P&gt;  modify itab transporting tot.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Feb 2009 13:03:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-25T13:03:19Z</dc:date>
    <item>
      <title>Sum calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203058#M1203714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having three fields in output 1 is directly fetched from table and other two are variables.&lt;/P&gt;&lt;P&gt;ITAB-MENGE  = fetched data.&lt;/P&gt;&lt;P&gt;ITAB-UCOMM = input on ( user command )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when the user press &lt;STRONG&gt;ENTER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ITAB-SUM = ITAB-MENGE  +  ITAB-UCOMM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eq:&lt;/P&gt;&lt;P&gt;Suppose if  &lt;STRONG&gt;ITAB-MENGE&lt;/STRONG&gt;  &lt;EM&gt;which is fetched from table&lt;/EM&gt;   =   100&lt;/P&gt;&lt;P&gt;and if the user enters the value in &lt;STRONG&gt;ITAB-UCOMM&lt;/STRONG&gt;   =   200  &lt;/P&gt;&lt;P&gt;and when the user press enter the sum should display on the other field &lt;STRONG&gt;ITAB-SUM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I am using normal write statement ( not ALV )  &amp;amp; there is no need of saving option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;R.Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 12:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203058#M1203714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sum calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203059#M1203715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;" ist enter the value in first field and do not press enter.
" Then place cursor on second input and write value. then press enter
" u can change code according to ur desire
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 .

SELECTION-SCREEN COMMENT 1(35) text1.
PARAMETERS: pmenge type i.
SELECTION-SCREEN COMMENT 50(1) text2 .
PARAMETERS: pucomm TYPE i MODIF ID dpt.
PARAMETERS: psum TYPE i MODIF ID dpt.


SELECTION-SCREEN END OF BLOCK a.

INITIALIZATION.
  text1 = 'Please Enter the values'.

AT SELECTION-SCREEN OUTPUT.

  IF pmenge IS INITIAL.
    pmenge = ''.
    pucomm = ''.
    psum = ''.
  ELSE.
    pmenge = pmenge.
    pucomm = pucomm.
    psum = pucomm + pmenge.


  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 12:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203059#M1203715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T12:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203060#M1203716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your query is ambiguous. Still I am answering as per my understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say you are selecting MENGE from database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you have UCOMM as parameter in selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if ITAB has following values,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;200&lt;/P&gt;&lt;P&gt;300&lt;/P&gt;&lt;P&gt;400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and UCOMM = 20 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;             menge type menge,&lt;/P&gt;&lt;P&gt;             tot(10) type c ,&lt;/P&gt;&lt;P&gt;         end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***already you selcetd data in ITAB&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  itab-tot = itab-menge + p_ucomm.&lt;/P&gt;&lt;P&gt;  modify itab transporting tot.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 13:03:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-calculation/m-p/5203060#M1203716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T13:03:19Z</dc:date>
    </item>
  </channel>
</rss>

