<?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: Logic required for a Internal table  issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617334#M1439935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i want to display in one row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u calculate manually and highlight the result how it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Feb 2010 15:21:29 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-02-15T15:21:29Z</dc:date>
    <item>
      <title>Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617329#M1439930</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;I have a small issue in the internal table logic. For the below data showing the structure of my internal table. Depends on data the internal table records will increase or decrease.&lt;/P&gt;&lt;P&gt;Currently my problem is i want to add Copyright Fee's (KSCHL= ZCFP) NETWR value and i want to display in one row.&lt;/P&gt;&lt;P&gt;For example the below data having 2 different material number, for 1st it should be 38 + 4.43 = 42.43. And the second material having 138 + 4.4 = 142.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

VBELN	           ARKTX	                   MATNR	NETWR	KSCHL	GR_KZWI1
9014000000	PRINTER (G T644N P3 EMEA ENG4	20G2091	        891.3           291.76
9014000000	Copyright Fee		                        38      ZCFP    1291.76
9014000000	Tax Jur Code Level 1		                167.27  ZTR1    1291.76
9014000000	Ausgangssteuer		                        836.33  ZTXD    1291.76
9014000000	Copyright Fee		                          4.43  ZCFP   1291.76
9014000000	Tax Jur Code Level 1		                19.48   ZTR1    1291.76
	         Ausgangssteuer		                      97.41   ZTXD   91.76

9014000001	PRINTER (G T644N P3 EMEA ENG4	20G2091	        891.3           291.76
9014000001	Copyright Fee		                       138      ZCFP    1291.76
9014000001	Tax Jur Code Level 1		                167.27  ZTR1    1291.76
9014000001	Ausgangssteuer		                        836.33  ZTXD    1291.76
9014000001	Copyright Fee		                           4.4  ZCFP   1291.76
9014000001	Tax Jur Code Level 1		                19.48   ZTR1    1291.76
	        Ausgangssteuer		                       97.41   ZTXD   91.76


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How i made a logic for this.??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 13:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617329#M1439930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-15T13:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617330#M1439931</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;Make sure your internal table is in the below order of fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN	&lt;STRONG&gt;KSCHL&lt;/STRONG&gt;             &lt;STRONG&gt;MATNR&lt;/STRONG&gt;	  &lt;STRONG&gt;NETWR		 ARKTX&lt;/STRONG&gt;	 GR_KZWI1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now after fetching the data, Loop at the internal table, for each record, do the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at Itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_SUM = V_SUM + itab-netwr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of MATNR&lt;/P&gt;&lt;P&gt;move the sum to another internal table&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 14:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617330#M1439931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-15T14:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617331#M1439932</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;Make sure your internal table is in the below order of fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN	&lt;STRONG&gt;KSCHL&lt;/STRONG&gt;             &lt;STRONG&gt;MATNR&lt;/STRONG&gt;	  &lt;STRONG&gt;NETWR		 ARKTX&lt;/STRONG&gt;	 GR_KZWI1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now after fetching the data, Loop at the internal table, for each record, do the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at Itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_SUM = V_SUM + itab-netwr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of MATNR&lt;/P&gt;&lt;P&gt;move the sum to another internal table&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 14:00:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617331#M1439932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-15T14:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617332#M1439933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use collect instead of append to create the entries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 14:02:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617332#M1439933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-15T14:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617333#M1439934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;  Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumptions&lt;/P&gt;&lt;P&gt;itab1 - actual data&lt;/P&gt;&lt;P&gt;itab2 - holds final data ( with added values )&lt;/P&gt;&lt;P&gt;wa1 - work area.&lt;/P&gt;&lt;P&gt;wa2 - holds copyright row with added values.&lt;/P&gt;&lt;P&gt;total - holds added values for a vbeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
total = 0.
flag = 0.
loop at itab1 into wa1.
  at new vbeln.
     if total ne 0.
         wa2-NETWR = total.
         append wa2 to itab2.
     endif.
     total = 0.
  endat. 

  if wa1-ARKTX ne 'Copyright Fee'.
    append wa1 into itab2.
  else.
    total = total + wa1-NETWR.
    wa2 = wa1.
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, this logic helps u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhavesh Solanki.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 14:04:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617333#M1439934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-15T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617334#M1439935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i want to display in one row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u calculate manually and highlight the result how it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2010 15:21:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6617334#M1439935</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-02-15T15:21:29Z</dc:date>
    </item>
  </channel>
</rss>

