<?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: Converting negative values in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874483#M367865</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;hi use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;abs&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;Thanks&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jan 2007 11:53:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-23T11:53:37Z</dc:date>
    <item>
      <title>Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874479#M367861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some negative and positive values in the internal table I want to make all the values to be positive. Following field has all the values dfkkop-betrw.&lt;/P&gt;&lt;P&gt;Pls tell me how to convert only negative values to positive values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx and Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 11:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874479#M367861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T11:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874480#M367862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read the records from internal table if value is negative multiply with -1&lt;/P&gt;&lt;P&gt;check the code below,&lt;/P&gt;&lt;P&gt;REPORT ZEX33 .&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       vbeln like likp-vbeln,&lt;/P&gt;&lt;P&gt;       netwr like likp-netwr,&lt;/P&gt;&lt;P&gt;       end of itab.&lt;/P&gt;&lt;P&gt;itab-vbeln = '0005002035'.&lt;/P&gt;&lt;P&gt;itab-netwr = '5.78'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;itab-vbeln = '0005002035'.&lt;/P&gt;&lt;P&gt;itab-netwr = '-3.25'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;itab-vbeln = '0005002035'.&lt;/P&gt;&lt;P&gt;itab-netwr = '-8.47'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;itab-vbeln = '0005002035'.&lt;/P&gt;&lt;P&gt;itab-netwr = '1.98'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at itab.&lt;/P&gt;&lt;P&gt; if itab-netwr &amp;lt; 0.&lt;/P&gt;&lt;P&gt; itab-netwr = itab-netwr * -1.&lt;/P&gt;&lt;P&gt;  modify itab index sy-tabix.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;  continue.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   write : / itab-vbeln , itab-netwr .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 11:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874480#M367862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T11:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874481#M367863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;multiply negative values  with -1 to make it positive .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if itab-f1 is &amp;lt; 0.
itab-f1 = itab-f1 * -1.
modify itab index sy-tabix transporitng f1." use this
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW check the boundaries of your requirement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 11:52:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874481#M367863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T11:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874482#M367864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT G_T_VBAP.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;    IF G_T_VBAP-betrw lt -1.&lt;/P&gt;&lt;P&gt;      MULTIPLY G_T_VBAP-betrw BY -1.&lt;/P&gt;&lt;P&gt;      MODIFY G_T_VBAP.&lt;/P&gt;&lt;P&gt;    ENDIF.&amp;lt;/b&amp;gt;  &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward.&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 11:52:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874482#M367864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T11:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874483#M367865</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;hi use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;abs&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;Thanks&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 11:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874483#M367865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T11:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874484#M367866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Line,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want it to be done fast:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols: &amp;lt;itab&amp;gt; like line of itab.
loop at itab assigning &amp;lt;itab&amp;gt; where betrw &amp;lt; 0.
 &amp;lt;itab&amp;gt;-betrw = - &amp;lt;itab&amp;gt;-betrw.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 12:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874484#M367866</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-01-23T12:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting negative values in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874485#M367867</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;jst chek whether the value is less than 0.. then multiply with -1. use the field symbols so u no need to modify the table again.. it directly works on the body of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols: &amp;lt;dfkkop&amp;gt; type xxxxx.
loo at dfkkop assigning &amp;lt;dfkkop&amp;gt; where betrw &amp;lt;= 0.
&amp;lt;dfkkop&amp;gt;-betrw = &amp;lt;dfkkop&amp;gt;-betrw * -1.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Close this thread.. when u r problem is solved&lt;/P&gt;&lt;P&gt;Reward if Helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Naresh Reddy K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2007 12:11:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-negative-values-in-internal-table/m-p/1874485#M367867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-23T12:11:44Z</dc:date>
    </item>
  </channel>
</rss>

