<?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: clear and refresh in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610872#M273858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ypra_sample61.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_itab,&lt;/P&gt;&lt;P&gt;        data1 TYPE char10,&lt;/P&gt;&lt;P&gt;        data2 TYPE char10,&lt;/P&gt;&lt;P&gt;       END OF ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE STANDARD TABLE OF ty_itab,&lt;/P&gt;&lt;P&gt;      wa_itab TYPE ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab1 TYPE ty_itab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      wa_itab1 TYPE ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab-data1 = '12'.&lt;/P&gt;&lt;P&gt;wa_itab-data2 = '112'.&lt;/P&gt;&lt;P&gt;APPEND wa_itab TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: wa_itab, itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Here the clear will clear both the header and as well as Body - Because&lt;/P&gt;&lt;P&gt;*it is declared as type standard table of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab1-data1 = '12'.&lt;/P&gt;&lt;P&gt;wa_itab1-data2 = '112'.&lt;/P&gt;&lt;P&gt;APPEND wa_itab1 TO itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: wa_itab1, itab1.&lt;/P&gt;&lt;P&gt;REFRESH: itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Here both the clear &amp;amp; refresh should be given to clear the workarea &amp;amp; *the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Oct 2006 16:34:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-13T16:34:20Z</dc:date>
    <item>
      <title>clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610867#M273853</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;I seem to have some confusion between clear and refresh. Do we use clear only for workareas and refresh only for internal tables?&lt;/P&gt;&lt;P&gt;Can you give me an example of how these clear and refresh works for an internal table with and with out header line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Krishen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610867#M273853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610868#M273854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;clear statement clears the header while refresh clears the body of Internal table ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb384e358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb384e358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:26:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610868#M273854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610869#M273855</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;  CLEAR resets to its initial values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;  For structure it will clear all the fields in the structure..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: S_MARA LIKE MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CLEAR: S_MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. For internal tables if it is declared with header line then it clear the header line otherwise it will clear the whole internal table..&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  EX:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  DATA: ITAB TYPE STANDARD TABLE OF MARA WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: ITAB..  " THis will clear the header line..&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  DATA: ITAB TYPE STANDARD TABLE OF MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: ITAB..  " THis will clear the whole internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Refresh clear the internal tables irrespective of with or without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Clear can be used for variables, work areas and internal tables..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610869#M273855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610870#M273856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CLEAR works with any variable (not just internal table work areas). It will set it to initial values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610870#M273856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610871#M273857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krishen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 types of clear statements we can use: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clear ITAB. This Statement will clear the Internal Table Header content. To clear the Intertal Table Hearder as well Body we can use Clear ITAB [ ] statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refresh will deletes the Internal Table content but still memory is not freed. &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;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:33:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610871#M273857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610872#M273858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ypra_sample61.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_itab,&lt;/P&gt;&lt;P&gt;        data1 TYPE char10,&lt;/P&gt;&lt;P&gt;        data2 TYPE char10,&lt;/P&gt;&lt;P&gt;       END OF ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE STANDARD TABLE OF ty_itab,&lt;/P&gt;&lt;P&gt;      wa_itab TYPE ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab1 TYPE ty_itab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      wa_itab1 TYPE ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab-data1 = '12'.&lt;/P&gt;&lt;P&gt;wa_itab-data2 = '112'.&lt;/P&gt;&lt;P&gt;APPEND wa_itab TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: wa_itab, itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Here the clear will clear both the header and as well as Body - Because&lt;/P&gt;&lt;P&gt;*it is declared as type standard table of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_itab1-data1 = '12'.&lt;/P&gt;&lt;P&gt;wa_itab1-data2 = '112'.&lt;/P&gt;&lt;P&gt;APPEND wa_itab1 TO itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: wa_itab1, itab1.&lt;/P&gt;&lt;P&gt;REFRESH: itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Here both the clear &amp;amp; refresh should be given to clear the workarea &amp;amp; *the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 16:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610872#M273858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T16:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610873#M273859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krishen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not use header lines (for itabs) you will never ever run into trouble with CLEAR and REFRESH. While you can use CLEAR on any variable I prefer to use CLEAR for fields and workareas and REFRESH for itabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 19:45:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610873#M273859</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-10-13T19:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610874#M273860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CLEAR also works for internal tables. I don't think I've ever seen it used, but:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR itab[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2006 19:57:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610874#M273860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-13T19:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610875#M273861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) &amp;lt;b&amp;gt;CLEAR&amp;lt;/b&amp;gt; is used to clear a  variable or a workarea... When you use it with internal table, it clears the HEADER of that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) REFRESH is only used with Internal tables. It removes all the body content of that internal table, but not the HEADER of that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR itab.
   Refresh itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When executing both these lines it will clear every thing from internal table ie... body content and header content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~thomas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2006 11:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610875#M273861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-16T11:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: clear and refresh</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610876#M273862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There appears to be some confusion about this. Clear will clear the specified data area. If an internal table has a header line then the clear works on the header line. If however the data field is expressly stated as the table body then the clear has the same effect as the Refresh.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: w_itab  type standard table of bseg,
      h_itab  type standard table of bseg 
              with header line.
...
* This only clears the header line.
clear h_itab.
* Where as this clears the body (and is the same as a refresh)
clear h_itab[].
* Since this is only a body, the table is refreshed
clear w_itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For program clarity I prefer to use clear for work areas, and refresh for table bodies.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Clear:  h_itab.
Refresh: h_itab,  w_itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do not forget the FREE command to recover memory after final use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MattG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2006 13:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-and-refresh/m-p/1610876#M273862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-16T13:00:33Z</dc:date>
    </item>
  </channel>
</rss>

