<?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: basic abap report queries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431263#M824190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are more worried about sy-subrc right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now suppose in the first loop pass the value that we want exist in the internal table and the corresponding values are passed on to the work area.in second loop pass if the required condition doesnot match then in the header of the table the previous data still exists coz you are not clearing it then the same data will be transferred one more time .&lt;/P&gt;&lt;P&gt;thats the reason we use sy-subrc so that only that get we get that sataisfies our condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will make it more clear rest all every body has cleared ur rest of ur doubts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2008 11:46:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-20T11:46:02Z</dc:date>
    <item>
      <title>basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431259#M824186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;LOOP AT gi_afko INTO gwa_afko.&lt;/P&gt;&lt;P&gt;      READ TABLE gi_mara INTO gwa_mara WITH KEY matnr = gwa_afko-plnbez.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MOVE   gwa_mara-mtart TO gwa_output-mtart.&lt;/P&gt;&lt;P&gt;        MOVE   gwa_mara-pstat TO gwa_output-pstat.&lt;/P&gt;&lt;P&gt;        MOVE  gwa_afko-aufnr TO gwa_output-aufnr.&lt;/P&gt;&lt;P&gt;        MOVE  gwa_afko-gamng TO gwa_output-gamng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        APPEND gwa_output TO gi_output.&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;&lt;/P&gt;&lt;P&gt;I am novice in ABAP. Please help me to understand the above coding portion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q. 1. Why sy-subrc IS INITIAL is checked before loop at....into wa... statement. If it is not checked there, what problem will occur?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.2. What does 'LOOP AT gi_afko INTO gwa_afko' statement mean?Does it mean that data of internal table &lt;/P&gt;&lt;P&gt;of afko being shifted to it's work area with each and every loop pass?What is the exact definition of internal table and work area? internal table is a temporary storage i think and what is work area?or what's the relationship between internal table and work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.3. what i've understood from the above coding portion that is data being read from internal table of mara to it's work area for the condition&lt;/P&gt;&lt;P&gt;matnr = gwa_afko-plnbez and then again 'sy-subrc is initial'&lt;/P&gt;&lt;P&gt;is being  checked. If sy-subrc is not checked here, what problem will occur?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q.4. What's the meaning of the statement &lt;/P&gt;&lt;P&gt;'APPEND gwa_output TO gi_output'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to understand.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 10:34:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431259#M824186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T10:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431260#M824187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. There might be some select/some statement to get the data before &lt;/P&gt;&lt;P&gt;that and sy-subrc is being checked if it succeeds .. &lt;/P&gt;&lt;P&gt;If the above statement is true then only gi_output will get the values ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Exactly. Internal table is being shifted to its work area one record at&lt;/P&gt;&lt;P&gt;a time in the loop.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. If sy-subrc = 0 .. i.e. if there is an entry then only gi_output will be &lt;/P&gt;&lt;P&gt;appended.(i.e. gwa_mara  will be filled in the read statement ).&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0 the U might be populating the same values from&lt;/P&gt;&lt;P&gt;gwa_output into gi_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. 'APPEND gwa_output TO gi_output'? ..&lt;/P&gt;&lt;P&gt;Inserts data in the work area gwa_output to the internal table gi_output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 10:46:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431260#M824187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431261#M824188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cinthia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Ans 1 : Sy-Subrc is INITIAL means ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            The Value of sy-subrc is 0. If it is 0 the condition is satisfied and then it executes your LOOP AT statement&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Ans 2  : While looping at gi_afko it moves one record into gwa_afko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             gwa_afko will consist only a single record at an instant of time and gi_afko will consist of a collection of records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ans 3 : If this condition is not Initial the MOVE stmts will not get executed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ans 4 : The Record in gwa_output will be added to the Internal Table gi_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need any further info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 10:52:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431261#M824188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T10:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431262#M824189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if sy-subrc is initial means sy-subrc = 0&lt;/P&gt;&lt;P&gt;it depends upon pervious functions performed .this indicates that previous function is succesfull&lt;/P&gt;&lt;P&gt;if u dnt specfiy the sy-subrc = 0 .u cannot catch the errors&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;even ever you are writting or reading the data from internal table that is donr only through work area only&lt;/P&gt;&lt;P&gt;work area will hold only one record at a time and interna; table will hold n number of records&lt;/P&gt;&lt;P&gt;both internal table as well as work area are temporary storage location only at the run time only memory will be allocated &lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;if the table is read successful then only move operation is performed&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;as work area consists of only one records to make the record inserted into table use append statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nandini P on Feb 20, 2008 12:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 11:03:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431262#M824189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T11:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431263#M824190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are more worried about sy-subrc right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now suppose in the first loop pass the value that we want exist in the internal table and the corresponding values are passed on to the work area.in second loop pass if the required condition doesnot match then in the header of the table the previous data still exists coz you are not clearing it then the same data will be transferred one more time .&lt;/P&gt;&lt;P&gt;thats the reason we use sy-subrc so that only that get we get that sataisfies our condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will make it more clear rest all every body has cleared ur rest of ur doubts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 11:46:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431263#M824190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T11:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: basic abap report queries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431264#M824191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are more worried about sy-subrc right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now suppose in the first loop pass the value that we want exist in the internal table and the corresponding values are passed on to the work area.in second loop pass if the required condition doesnot match then in the header of the table the previous data still exists coz you are not clearing it then the same data will be transferred one more time .&lt;/P&gt;&lt;P&gt;thats the reason we use sy-subrc so that only that get we get that sataisfies our condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will make it more clear rest all every body has cleared ur rest of ur doubts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 17:12:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/basic-abap-report-queries/m-p/3431264#M824191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T17:12:56Z</dc:date>
    </item>
  </channel>
</rss>

