<?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 alternate code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182106#M757615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can any one provide me alternate code for following statement using 1.READ from internal table, 2. by using "for all entries".&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;following is the code&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TABLE J_5HPDBEAR&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; LOOP AT gt_cr INTO gs_cr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   SELECT *  FROM j_5hpdbear WHERE annuser = gs_cr-ausfuehrer.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-vorname = j_5hpdbear-vorname.               "First name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-nachname = j_5hpdbear-nachname.             "last name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-mail = j_5hpdbear-mail.                     "mail id&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     MODIFY gt_cr FROM gs_cr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDSELECT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;here gs-cr is the header for gt_cr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Dec 2007 07:05:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-07T07:05:47Z</dc:date>
    <item>
      <title>alternate code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182106#M757615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can any one provide me alternate code for following statement using 1.READ from internal table, 2. by using "for all entries".&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;following is the code&amp;lt;/u&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TABLE J_5HPDBEAR&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; LOOP AT gt_cr INTO gs_cr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   SELECT *  FROM j_5hpdbear WHERE annuser = gs_cr-ausfuehrer.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-vorname = j_5hpdbear-vorname.               "First name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-nachname = j_5hpdbear-nachname.             "last name&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     gs_cr-mail = j_5hpdbear-mail.                     "mail id&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     MODIFY gt_cr FROM gs_cr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDSELECT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;here gs-cr is the header for gt_cr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:05:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182106#M757615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: alternate code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182107#M757616</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;if gt_cr is not initial.&lt;/P&gt;&lt;P&gt;select * form J_5HPDBEAR into table itab&lt;/P&gt;&lt;P&gt;             for all entries in gt_cr&lt;/P&gt;&lt;P&gt;             where annuser = gt_cr-annuser.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next do what ever you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siva Kuamr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 09:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182107#M757616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T09:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: alternate code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182108#M757617</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;do like this.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TABLE J_5HPDBEAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; If gt_cr is not intial.
  SELECT * FROM j_5hpdbear into table git_j_5hpdbear  for all entries in gt_cr WHERE annuser = gt_cr-ausfuehrer.
endif.
 sort git_j_5hpdbear by annuser.
 LOOP AT gt_cr INTO gs_cr.
  Read table git_j_5hpdbear into wa_j_5hpdbear with key annuser = gs_cr-annuser binary search.
  if sy-subrc = 0.
   gs_cr-vorname = wa_j_5hpdbear-vorname. "First name
   gs_cr-nachname = wa_j_5hpdbear-nachname. "last name
   gs_cr-mail = wa_j_5hpdbear-mail. "mail id
   MODIFY gt_cr FROM gs_cr.
   clear gs_cr.
  endif.
 ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 09:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182108#M757617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T09:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: alternate code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182109#M757618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if not gt_cr is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from j_5hpdbear &lt;/P&gt;&lt;P&gt;into table gt_j_5hpdbear &lt;/P&gt;&lt;P&gt;for all entries in gt_cr&lt;/P&gt;&lt;P&gt;where annuser = gt_cr-ausfuehrer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at gt_cr into gs_cr.&lt;/P&gt;&lt;P&gt;read table gt_j_5hpdbear  into wa_j_5hpdbear where annuser = gs_cr-ausfuehrer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_j_5hpdbear-vorname to gs_cr-vorname ,&lt;/P&gt;&lt;P&gt;wa_j_5hpdbear-nachname to gs_cr-nachname,&lt;/P&gt;&lt;P&gt;wa_j_5hpdbear-mail to gs_cr-mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify gt_cr from gs_cr index sy-tabix transporting vorname nachname mail .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&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;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 18:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternate-code/m-p/3182109#M757618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T18:34:03Z</dc:date>
    </item>
  </channel>
</rss>

