<?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 issue. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348528#M1398533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Nov 2009 07:39:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-18T07:39:49Z</dc:date>
    <item>
      <title>sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348523#M1398528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi masters,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an issue where am calculating months per contract.&lt;/P&gt;&lt;P&gt;if i have one contract ex : 2001198 -  the sum of months to this contract is - 36.&lt;/P&gt;&lt;P&gt;if i have another contract ex : 7866540 - the sum of months to this contract is  - 46.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirment is i need to take the sum per contract and not total sum of 2 contracts how can i do this please can anyone tell please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code.&lt;/P&gt;&lt;P&gt; clear lzmonths.&lt;/P&gt;&lt;P&gt;      LOOP AT svtab1 INTO  st_tab1 where  condtype = 'R0' .                                                  " months&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;               i_datum_bis         = st_tab1-condvalidto&lt;/P&gt;&lt;P&gt;               i_datum_von         = st_tab1-condvalidfrom&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                I_KZ_INCL_BIS       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;               e_monate            = count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        st_tab1-zmonths = count + 1.&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;        lzmonths = lzmonths + st_tab1-zmonths .    " sum of months  i get into lzmonths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MODIFY svtab1 FROM st_tab1 TRANSPORTING zmonths.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so how can i get per contract please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;pasala.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 06:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348523#M1398528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-11T06:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348524#M1398529</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;Use control break events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZSELECTION_SCREEN .&lt;/P&gt;&lt;P&gt;*************************************&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;         F1(3) TYPE  C,&lt;/P&gt;&lt;P&gt;         F2 TYPE  I,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        F3  TYPE  I ,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         F3 TYPE  P DECIMALS 2,&lt;/P&gt;&lt;P&gt;       END OF ITAB.&lt;/P&gt;&lt;P&gt;DATA WA LIKE ITAB.&lt;/P&gt;&lt;P&gt;DATA : CNT TYPE N,&lt;/P&gt;&lt;P&gt;       TOTAL TYPE STRING ,&lt;/P&gt;&lt;P&gt;       SUM TYPE  P DECIMALS 2.&lt;/P&gt;&lt;P&gt;DATA NO TYPE SY-LINNO.&lt;/P&gt;&lt;P&gt;****************************************&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A01'. ITAB-F2 = 25. ITAB-F3 = '1000.12'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A02'. ITAB-F2 = 20. ITAB-F3 = '900.23'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A01'. ITAB-F2 = 35. ITAB-F3 = '1200.65'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A03'. ITAB-F2 = 15. ITAB-F3 = '800'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A01'. ITAB-F2 = 15.ITAB-F3 = '1000'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A02'. ITAB-F2 = 45. ITAB-F3 = '2000'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 'A01'. ITAB-F2 = 55. ITAB-F3 = '1500'.&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB BY F1.&lt;/P&gt;&lt;P&gt;*****************************************&lt;/P&gt;&lt;P&gt;LOOP AT ITAB .&lt;/P&gt;&lt;P&gt;AT NEW F1.&lt;/P&gt;&lt;P&gt;WRITE:/ 'TYPE :',ITAB-F1 ,20 'COUNT : CNT ' ,35 'TOTAL : TAT' .&lt;/P&gt;&lt;P&gt;NO = SY-LINNO.&lt;/P&gt;&lt;P&gt;WRITE:/20 'QUANTITY' ,40 'AMOUNT'       .&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE :/15 ITAB-F2,30 ITAB-F3  .&lt;/P&gt;&lt;P&gt;CNT = CNT + 1.&lt;/P&gt;&lt;P&gt;SUM = SUM + ITAB-F3.&lt;/P&gt;&lt;P&gt;AT END OF F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*SUM.&lt;/P&gt;&lt;P&gt;TOTAL = SUM.&lt;/P&gt;&lt;P&gt;READ LINE NO .&lt;/P&gt;&lt;P&gt;REPLACE 'CNT' WITH CNT INTO SY-LISEL.&lt;/P&gt;&lt;P&gt;REPLACE 'TAT' WITH TOTAL INTO SY-LISEL.&lt;/P&gt;&lt;P&gt;MODIFY CURRENT LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CNT = 0.&lt;/P&gt;&lt;P&gt;SUM = 0.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thansk,&lt;/P&gt;&lt;P&gt;Nelson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 06:39:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348524#M1398529</guid>
      <dc:creator>nelsonkarunakar_darla2</dc:creator>
      <dc:date>2009-11-11T06:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348525#M1398530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you nelson.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am using my code in BADI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i have all the data in  svtab1.&lt;/P&gt;&lt;P&gt;to get the number of months i am using a function module and i get the months per contract.&lt;/P&gt;&lt;P&gt;but how can i tell the system to look per contract and take the number of months by contract?&lt;/P&gt;&lt;P&gt;am confused here and i really need ur input please.&lt;/P&gt;&lt;P&gt;can you please tell me from my code instead of your code please if you dont mind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT svtab1 INTO  st_tab1 where  condtype = 'R0' &lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'&lt;/P&gt;&lt;P&gt;            EXPORTING&lt;/P&gt;&lt;P&gt;               i_datum_bis         = st_tab1-condvalidto&lt;/P&gt;&lt;P&gt;               i_datum_von         = st_tab1-condvalidfrom&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                I_KZ_INCL_BIS       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            IMPORTING&lt;/P&gt;&lt;P&gt;               e_monate            = count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        st_tab1-zmonths = count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        lzmonths = lzmonths + st_tab1-zmonths .              &lt;STRONG&gt;here i get total months but not per contract how can i say per contract?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        MODIFY svtab1 FROM st_tab1 TRANSPORTING zmonths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 07:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348525#M1398530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-11T07:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348526#M1398531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see some thing worng here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
st_tab1-zmonths = count + 1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try changing it to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;st_tab1-zmonths = st_tab1-zmonths + count .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 07:55:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348526#M1398531</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-11-11T07:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348527#M1398532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi keshu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get the no of months into count and i add 1 to ger the current month as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;total of all the months per contract i get into a  variable called  LZMONTH where i have the total of all the months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since i said&lt;/P&gt;&lt;P&gt; lzmonths = lzmonths + st_tab1-zmonths .&lt;/P&gt;&lt;P&gt;it looks the total of all the months but not the total per contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so how can i say take the total months per contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;pasala.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 08:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348527#M1398532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-11T08:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: sum issue.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348528#M1398533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 07:39:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-issue/m-p/6348528#M1398533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-18T07:39:49Z</dc:date>
    </item>
  </channel>
</rss>

