<?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: Difference Between Reset &amp; clear in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566646#M585659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR&amp;lt;/b&amp;gt; dobj [ {WITH val [IN {BYTE|CHARACTER} MODE] } &lt;/P&gt;&lt;P&gt;           | {WITH NULL} ]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Without the optional additions, the data object dobj is assigned the type-specific initial value. The following applies: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The initial values are assigned to elementary data types according to the table of built-in ABAP types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference variables are assigned null references. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structures are set to their initial values component by component. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All rows in an internal table are deleted. All the memory required for the table, except for the initial memory requirement, is released (see Declaring Internal Tables). The FREE statement is used to release the memory space occupied by the rows of internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional additions allow you to fill the spaces of a data object with other values than the initial value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If dobj is an internal table with a header line, you must specify dobj[] to delete the rows, otherwise only the header line will be deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... WITH val [IN {BYTE|CHARACTER} MODE] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If you use the WITH val addition and specify BYTE or CHARACTER MODE, all spaces are replaced either with the first byte or the first character in val. If dobj is of the type string or xstring (as of Release 6.10), the string is processed in its current length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IN BYTE and CHARACTER MODE additions can be used as of Release 6.10 (see also Processing Byte Strings and Character Strings ). Without specification and before Release 6.10 the IN CHARACTER MODE addition applies. Depending on the addition, the data object dobj must be either byte-type or character-type and the data object val must be either byte-type or character type and have the length 1. Before Release 6.10, dobj and val must be flat. If dobj and val do not have the correct type and correct length in a non- Unicode program, they are still handled as if they do, independently of the actual type. In Unicode programs, this will cause a Syntax error or an exception that cannot be handled. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The byte string hexstring as assigned a specific byte value over the entire current length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: hexstring TYPE xstring, &lt;/P&gt;&lt;P&gt;      hex(1)    TYPE x VALUE 'FF'. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;hexstring = '00000000'. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;CLEAR hexstring WITH hex IN BYTE MODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... WITH NULL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition, which is not allowed in ABAP Objects, replaces all bytes of dobj with the value hexadecimal 0. In this case, the data object dobj must be flat. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The WITH NULL addition should only be used for byte-type data objects and therefore be replaced with the CLEAR WITH val addition, which - in this context - at least ensures a higher level of security in Unicode programs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FREE&amp;lt;/b&amp;gt; dobj. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The FREE statement has the same effect as the CLEAR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement for any data objects except internal tables. &lt;/P&gt;&lt;P&gt;For internal tables, FREE has the same effect as the REFRESH statement. It releases the entire memory area occupied by the table rows. If dobj is a structure with table-like components, the memory of each table-like component is released. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If dobj is an internal table with a header line , FREE has the same effect as REFRESH on the table body, and not the header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT &amp;lt;b&amp;gt;RESET&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition sets all formatting settings for which the corresponding addition is not specified in the same FORMAT statement to the state OFF, apart from the setting of the FRAMES addition, which is set to ON. For settings whose addition is also specified, the RESET addition has no effect, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you need regarding &amp;lt;b&amp;gt;REFRESH&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement sets an internal table itab to its initial value, meaning that it deletes all rows of the internal table. The memory space required for the table is freed up to the initial memory size INITIAL SIZE. For itab, you must specify an internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete all rows and free the entire memory space occupied by rows, you can use the statement FREE. &lt;/P&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;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2007 07:28:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-01T07:28:55Z</dc:date>
    <item>
      <title>Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566639#M585652</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;   Can you tell me what is difference between 'Clear', 'Reset' and 'Free'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet Padwal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566639#M585652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566640#M585653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its almost same in most cases.but diffrent in case of internal tables with header lines(work areas).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T_Mara type table of mara with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear t_mara . " clears the header line(work area)&lt;/P&gt;&lt;P&gt;refresh t_mara . " clear the internal table.&lt;/P&gt;&lt;P&gt;free t_mara." clears aboth internal table and work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewardif useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:23:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566640#M585653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566641#M585654</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;RESET Resets all formats (color, intensified, inverse, hotspot and&lt;/P&gt;&lt;P&gt;input).&lt;/P&gt;&lt;P&gt;This corresponds to the command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT COLOR OFF INTENSIFIED OFF INVERSE OFF HOTSPOT OFF INPUT&lt;/P&gt;&lt;P&gt;OFF.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&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;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566641#M585654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566642#M585655</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;This the main differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Clear&amp;lt;/b&amp;gt; : it will clear the variable or work area content.&lt;/P&gt;&lt;P&gt;bt it cannot be used dirctly with internal table.&lt;/P&gt;&lt;P&gt;u have to use like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR ITAB[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Refresh&amp;lt;/b&amp;gt; : it will clear both ITAB and work Area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt;: it will clear the MEMORY alloted and content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope u gt the idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566642#M585655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566643#M585656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear&amp;lt;/b&amp;gt; -- to clear the data of the internal table header&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear[]&amp;lt;/b&amp;gt; -- to clear the body of the internal table&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;refresh&amp;lt;/b&amp;gt; -- clears the internal table data from header and body&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;free&amp;lt;/b&amp;gt; --  deletes the data of the internal table and also deletes the memory area allocated to the internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*&lt;STRONG&gt;reward for useful answers&lt;/STRONG&gt;*&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:51:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566643#M585656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566644#M585657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like all data objects, you can initialize internal tables with the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement. This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR &amp;lt;itab&amp;gt;[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure that the table itself has been initialized, you can use the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement. This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated. To release the memory space, use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use FREE to initialize an internal table and release its memory space without first using the REFRESH or CLEAR statement. Like REFRESH, FREE works on the table body, not on the table work area. After a FREE statement, you can address the internal table again. It still occupies the amount of memory required for its header (currently 256 bytes). When you refill the table, the system has to allocate new memory space to the lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COL1,&lt;/P&gt;&lt;P&gt;COL2,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA ITAB LIKE TABLE OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINE-COL1 = 'A'. LINE-COL2 = 'B'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ITAB IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE 'ITAB is empty'.&lt;/P&gt;&lt;P&gt;FREE ITAB.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this program, an internal table ITAB is filled and then initialized with REFRESH. The IF statement uses the expression ITAB IS INITIAL to find out whether ITAB is empty. If so, the memory is released.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To reset a variable var to the appropriate initial value for its type, use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement has different effects for different data types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        Elementary ABAP types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CLEAR statement sets the value of elementary variables to their initial value (see the keyword documentation) not to the start value, which is set using the VALUE parameter of the DATA statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        References&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CLEAR statement resets a reference variable to its initial value, that is, so that it does not point to an object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        Structures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CLEAR statement resets the individual components of a structure to their respective initial values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#65399;        Internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CLEAR statement deletes the entire contents of an internal table (see also Initializing Internal Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use the CLEAR statement to reset a constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_data_clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA number TYPE i VALUE '10'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE / number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output appears as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CLEAR statement resets the contents of the field number from 10 to its initial value 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:52:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566644#M585657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T11:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566645#M585658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Free - It deletes all the rows and free the associated memory i.e. free itab.&lt;/P&gt;&lt;P&gt;refresh - It deletes all the rows but memory remains allocated i.e. refresh itab.&lt;/P&gt;&lt;P&gt;Clear - It deletes all the rows and leave the memory allocated but clear the header line i.e. clear itab.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;chk this also&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb384e358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb384e358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 12:08:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566645#M585658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T12:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566646#M585659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR&amp;lt;/b&amp;gt; dobj [ {WITH val [IN {BYTE|CHARACTER} MODE] } &lt;/P&gt;&lt;P&gt;           | {WITH NULL} ]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Without the optional additions, the data object dobj is assigned the type-specific initial value. The following applies: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The initial values are assigned to elementary data types according to the table of built-in ABAP types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference variables are assigned null references. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structures are set to their initial values component by component. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All rows in an internal table are deleted. All the memory required for the table, except for the initial memory requirement, is released (see Declaring Internal Tables). The FREE statement is used to release the memory space occupied by the rows of internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional additions allow you to fill the spaces of a data object with other values than the initial value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If dobj is an internal table with a header line, you must specify dobj[] to delete the rows, otherwise only the header line will be deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... WITH val [IN {BYTE|CHARACTER} MODE] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If you use the WITH val addition and specify BYTE or CHARACTER MODE, all spaces are replaced either with the first byte or the first character in val. If dobj is of the type string or xstring (as of Release 6.10), the string is processed in its current length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IN BYTE and CHARACTER MODE additions can be used as of Release 6.10 (see also Processing Byte Strings and Character Strings ). Without specification and before Release 6.10 the IN CHARACTER MODE addition applies. Depending on the addition, the data object dobj must be either byte-type or character-type and the data object val must be either byte-type or character type and have the length 1. Before Release 6.10, dobj and val must be flat. If dobj and val do not have the correct type and correct length in a non- Unicode program, they are still handled as if they do, independently of the actual type. In Unicode programs, this will cause a Syntax error or an exception that cannot be handled. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The byte string hexstring as assigned a specific byte value over the entire current length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: hexstring TYPE xstring, &lt;/P&gt;&lt;P&gt;      hex(1)    TYPE x VALUE 'FF'. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;hexstring = '00000000'. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;CLEAR hexstring WITH hex IN BYTE MODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... WITH NULL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition, which is not allowed in ABAP Objects, replaces all bytes of dobj with the value hexadecimal 0. In this case, the data object dobj must be flat. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The WITH NULL addition should only be used for byte-type data objects and therefore be replaced with the CLEAR WITH val addition, which - in this context - at least ensures a higher level of security in Unicode programs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FREE&amp;lt;/b&amp;gt; dobj. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The FREE statement has the same effect as the CLEAR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement for any data objects except internal tables. &lt;/P&gt;&lt;P&gt;For internal tables, FREE has the same effect as the REFRESH statement. It releases the entire memory area occupied by the table rows. If dobj is a structure with table-like components, the memory of each table-like component is released. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If dobj is an internal table with a header line , FREE has the same effect as REFRESH on the table body, and not the header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORMAT &amp;lt;b&amp;gt;RESET&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition sets all formatting settings for which the corresponding addition is not specified in the same FORMAT statement to the state OFF, apart from the setting of the FRAMES addition, which is set to ON. For settings whose addition is also specified, the RESET addition has no effect, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you need regarding &amp;lt;b&amp;gt;REFRESH&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement sets an internal table itab to its initial value, meaning that it deletes all rows of the internal table. The memory space required for the table is freed up to the initial memory size INITIAL SIZE. For itab, you must specify an internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete all rows and free the entire memory space occupied by rows, you can use the statement FREE. &lt;/P&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;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 07:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566646#M585659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T07:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566647#M585660</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;&amp;lt;b&amp;gt;Clear Statement:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear statement intializes the specified variable.&lt;/P&gt;&lt;P&gt;with internal table it works as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the internal table is with header line then It clears the content of the header line . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To clear the content of the body of the internal table u must specify the statement as  &amp;lt;b&amp;gt;Clear itab[].&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If the internal table has header line then &amp;lt;b&amp;gt;CLEAR itab&amp;lt;/b&amp;gt; statement clears only the Header line content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Free statement :&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Free statement deletes all the row of the internal table . Header line remains unchanged .  The memory space required for the table is freed up to the initial memory size INITIAL SIZE.&lt;/P&gt;&lt;P&gt;So to delete all rows and free the entire memory space occupied by rows, you can use the statement FREE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Refresh Statement:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refresh statement deletes all the row of the internal table . header line remains unchanged . memory space remains occupied.If the internal table does not have the header line then it behaves like CLEAR statement .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 12:56:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566647#M585660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T12:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566648#M585661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhijeet,&lt;/P&gt;&lt;P&gt;                     This is quite simple to remember........&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Deleting of Data/Contents on InternalTable:-&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;1)&amp;lt;b&amp;gt;Free Itab:&amp;lt;/b&amp;gt; Deletes all records from "&amp;lt;b&amp;gt;Body of InternalTable as well as data from header line &amp;amp; memory to&amp;lt;/b&amp;gt;".&lt;/P&gt;&lt;P&gt;2)&amp;lt;b&amp;gt;Refresh Itab:&amp;lt;/b&amp;gt;Deletes data from "&amp;lt;b&amp;gt;BODY+HEADER LINE&amp;lt;/b&amp;gt;".&lt;/P&gt;&lt;P&gt;3)&amp;lt;b&amp;gt;Clear Itab[ ]:&amp;lt;/b&amp;gt; Deletes only "&amp;lt;b&amp;gt;Internal Table Body contents&amp;lt;/b&amp;gt;".&lt;/P&gt;&lt;P&gt;4)&amp;lt;b&amp;gt;Clear itab:&amp;lt;/b&amp;gt;   Deletes &amp;lt;b&amp;gt;"Header Line Only".&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward Points for useful answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Sudheer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 14:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566648#M585661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T14:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference Between Reset &amp; clear</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566649#M585662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhijeet,&lt;/P&gt;&lt;P&gt; Plz mark the thread as Answered if ur query was resolved.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sudheer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 14:52:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-reset-clear/m-p/2566649#M585662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-13T14:52:42Z</dc:date>
    </item>
  </channel>
</rss>

