<?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: Reg. Read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660429#M292768</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure to clear the line before moving to it.  This will insure that it is clean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if GP_EKGRP eq 'X'.
LOOP AT GT_OUT where Fname+0(5) = 'EKGRP'.
*read table gt_out with key Fname+0(5) = 'EKGRP'.
If sy-subrc eq 0.
&amp;lt;b&amp;gt;clear gt_final.&amp;lt;/b&amp;gt;
MOVE-CORRESPONDING: GT_out TO GT_final.
append gt_final.
endif.
endloop.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2006 19:45:50 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-11-08T19:45:50Z</dc:date>
    <item>
      <title>Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660424#M292763</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;I need to append the records from GT_OUT to GT_FINAL based on condition. see the coding below. But it is giving repeated data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if GP_EKGRP eq 'X'.&lt;/P&gt;&lt;P&gt;LOOP AT GT_OUT where Fname+0(5) = 'EKGRP'.&lt;/P&gt;&lt;P&gt;*read table gt_out with key Fname+0(5) = 'EKGRP'.&lt;/P&gt;&lt;P&gt;If sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;append gt_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at gt_out where Fname+0(5) = 'NETWR'.&lt;/P&gt;&lt;P&gt;if GP_DIFWR eq 'X'.&lt;/P&gt;&lt;P&gt;*read table gt_out with key Fname+0(5) = 'NETWR'.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;append gt_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you plz help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 18:12:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660424#M292763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T18:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660425#M292764</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;&lt;/P&gt;&lt;P&gt;Check how you are populating the internal table GT_OUT..To make sure the records is not duplicate in GT_OUT..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Narendran Muthukumaran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 18:16:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660425#M292764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T18:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660426#M292765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want one instance of the record based on the FNAME, then you need to READ the GT_FINAL and check sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if GP_EKGRP eq 'X'.
LOOP AT GT_OUT where Fname+0(5) = 'EKGRP'.
 &amp;lt;b&amp;gt;read table gt_final with key Fname+0(5) = 'EKGRP'.
&amp;lt;/b&amp;gt;   If sy-subrc &amp;lt;b&amp;gt;&amp;lt;&amp;gt;&amp;lt;/b&amp;gt; 0.
   MOVE-CORRESPONDING: GT_out TO GT_final.
   append gt_final.
 endif.
endloop.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at gt_out where Fname+0(5) = 'NETWR'.
if GP_DIFWR eq 'X'.
read table &amp;lt;b&amp;gt;gt_final&amp;lt;/b&amp;gt; with key Fname+0(5) = 'NETWR'.
if sy-subrc &amp;lt;b&amp;gt;&amp;lt;&amp;gt;&amp;lt;/b&amp;gt; 0.
MOVE-CORRESPONDING: GT_out TO GT_final.
append gt_final.
endif.
endif.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 18:16:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660426#M292765</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-08T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660427#M292766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to append all the records where Fname = EKGRP. Say for a particular Ebeln has Fname EKGRP 5 times. I need to append all the five records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 19:41:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660427#M292766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T19:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660428#M292767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so then you original code should work.  What exactly is the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 19:43:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660428#M292767</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-08T19:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660429#M292768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure to clear the line before moving to it.  This will insure that it is clean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if GP_EKGRP eq 'X'.
LOOP AT GT_OUT where Fname+0(5) = 'EKGRP'.
*read table gt_out with key Fname+0(5) = 'EKGRP'.
If sy-subrc eq 0.
&amp;lt;b&amp;gt;clear gt_final.&amp;lt;/b&amp;gt;
MOVE-CORRESPONDING: GT_out TO GT_final.
append gt_final.
endif.
endloop.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 19:45:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660429#M292768</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-08T19:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660430#M292769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich - yes it is working but I need to put such type 13 conditions. It means i have to loop the same table for 13 times. what about performance.  Pls find the pease of code for 3 conditions.. it is working but..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if GP_EKGRP eq 'X'.&lt;/P&gt;&lt;P&gt;LOOP AT GT_OUT where Fname+0(5) = 'EKGRP'.&lt;/P&gt;&lt;P&gt;*read table gt_out with key Fname+0(5) = 'EKGRP'.&lt;/P&gt;&lt;P&gt;If sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;clear gt_final.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;append gt_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if GP_DIFWR eq 'X'.&lt;/P&gt;&lt;P&gt;loop at gt_out where Fname+0(5) = 'NETWR'.&lt;/P&gt;&lt;P&gt;*read table gt_out with key Fname+0(5) = 'NETWR'.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;clear gt_final.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;append gt_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if GP_ittxt eq 'X'.&lt;/P&gt;&lt;P&gt;loop at gt_out where tabname+0(9) = 'EINKBELEG'.&lt;/P&gt;&lt;P&gt;*read table gt_out with key Fname+0(5) = 'NETWR'.&lt;/P&gt;&lt;P&gt;clear gt_final.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;append gt_final.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 20:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660430#M292769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T20:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660431#M292770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you dont have to write the loop multiple times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop it once without any condition.&lt;/P&gt;&lt;P&gt;check condition 1, &lt;/P&gt;&lt;P&gt;perform ur task,&lt;/P&gt;&lt;P&gt;else check condition 2,&lt;/P&gt;&lt;P&gt;perform ur task,&lt;/P&gt;&lt;P&gt;and so on&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 20:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660431#M292770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T20:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660432#M292771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if GP_EKGRP eq 'X'.&lt;/P&gt;&lt;P&gt;LOOP AT GT_OUT.&lt;/P&gt;&lt;P&gt; if gt_out-Fname+0(5) = 'EKGRP'&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;  append gt_final.&lt;/P&gt;&lt;P&gt; elseif gt_out-Fname+0(5) = 'NETWR'&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING: GT_out TO GT_final.&lt;/P&gt;&lt;P&gt;  append gt_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on u can add.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; endif.&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;shree.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 20:48:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660432#M292771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-08T20:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reg. Read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660433#M292772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not exactly sure of your requirment, but you don't have to loop 13 times, but just once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


LOOP AT GT_OUT.


if GP_EKGRP eq 'X'
   and gt_out-Fname+0(5) = 'EKGRP'..
clear gt_final.
MOVE-CORRESPONDING: GT_out TO GT_final.
append gt_final.
continue.
endif.

if GP_DIFWR eq 'X'
   and gt_out-Fname+0(5) = 'NETWR'..
clear gt_final.
MOVE-CORRESPONDING: GT_out TO GT_final.
append gt_final.
continue.
endif.

endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2006 20:54:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-read-statement/m-p/1660433#M292772</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-08T20:54:46Z</dc:date>
    </item>
  </channel>
</rss>

