<?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 at command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644373#M877593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the difference between "at commands" like at new ,at last etc and "on change of".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2008 12:47:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-17T12:47:53Z</dc:date>
    <item>
      <title>at command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644373#M877593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the difference between "at commands" like at new ,at last etc and "on change of".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 12:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644373#M877593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T12:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: at command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644374#M877594</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;Control break statements are used to stop the control at a particular point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. AT NEW . &lt;/P&gt;&lt;P&gt;2. AT END OF . &lt;/P&gt;&lt;P&gt;3. AT FIRST. &lt;/P&gt;&lt;P&gt;4. AT LAST. &lt;/P&gt;&lt;P&gt;5.ON CHANGE OF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the start of a new control level (i.e. immediately after AT ), the following occurs in the output area of the current LOOP statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All default key fields (on the right) are filled with "*" after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other fields (on the right) are set to their initial values after the current control level key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Between AT and ENDAT , you can use SUM to insert the appropriate control totals in the number fields (see also ABAP/4 number types ) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level ( AT FIRST , AT NEW f ) and also the end of a control level ( AT END OF f , AT LAST ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the control level processing (i.e. after ENDAT ), the old contents of the LOOP output area are restored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;When calculating totals, you must ensure that the totals are inserted into the same sub-fields of the LOOP output area as those where the single values otherwise occur. If there is an overflow, processing terminates with a runtime error. &lt;/P&gt;&lt;P&gt;If an internal table is processed only in a restricted form (using the additions FROM , TO and/or WHERE with the LOOP statement), you should not use the control structures for control level processing because the interaction of a restricted LOOP with the AT statement is currenly not properly defined. &lt;/P&gt;&lt;P&gt;With LOOP s on extracts, there are also special control break control structures you can use. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;Runtime errors &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM_OVERFLOW : Overflow when calculating totals with SUM . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1&lt;/P&gt;&lt;P&gt;AT NEW f. &lt;/P&gt;&lt;P&gt;Variant 2&lt;/P&gt;&lt;P&gt;AT END OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;f is a sub-field of an internal table processed with LOOP . The sequence of statements which follow it is executed if the sub-field f or a sub-field in the current LOOP line defined (on the left) before f has a differnt value than in the preceding ( AT NEW ) or subsequent ( AT END OF ) table line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF COMPANIES OCCURS 20,&lt;/P&gt;&lt;P&gt;NAME(30),&lt;/P&gt;&lt;P&gt;PRODUCT(20),&lt;/P&gt;&lt;P&gt;SALES TYPE I,&lt;/P&gt;&lt;P&gt;END OF COMPANIES.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;LOOP AT COMPANIES.&lt;/P&gt;&lt;P&gt;AT NEW NAME.&lt;/P&gt;&lt;P&gt;NEW-PAGE.&lt;/P&gt;&lt;P&gt;WRITE / COMPANIES-NAME.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES.&lt;/P&gt;&lt;P&gt;AT END OF NAME.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;WRITE: / COMPANIES-NAME, COMPANIES-SALES.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AT statements refer to the field COMPANIES-NAME . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;If a control break criterion is not known until runtime, you can use AT NEW (name) or AT END OF (name) to specify it dynamically as the contents of the field name . If name is blank at runtime, the control break criterion is ignored and the sequence of statements is not executed. If name contains an invalid component name, a runtime error occurs. &lt;/P&gt;&lt;P&gt;By defining an offset and/or length, you can further restrict control break criteria - regardless of whether they are specified statically or dynamically. &lt;/P&gt;&lt;P&gt;A field symbol pointing to the LOOP output area can also be used as a dynamic control break criterion. If the field symbol does not point to the LOOP output area, a runtime error occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;Runtime errors &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT_BAD_PARTIAL_FIELD_ACCESS : Invalid sub-field access when dynamically specifying the control break criterion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT_ITAB_FIELD_INVALID : When dynamically specifying the control break criterion via a field symbol, the field symbol does not point to the LOOP output area. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB_ILLEGAL_COMPONENT : When dynamically specifying the control break criterion via (name) the field name does not contain a valid sub-field name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3&lt;/P&gt;&lt;P&gt;AT FIRST. &lt;/P&gt;&lt;P&gt;Variant 4&lt;/P&gt;&lt;P&gt;AT LAST. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the appropriate sequence of statements once during the first ( AT FIRST ) or last ( AT LAST ) loop pass. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF COMPANIES OCCURS 20,&lt;/P&gt;&lt;P&gt;NAME(30),&lt;/P&gt;&lt;P&gt;PRODUCT(20),&lt;/P&gt;&lt;P&gt;SALES TYPE I,&lt;/P&gt;&lt;P&gt;END OF COMPANIES.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;LOOP AT COMPANIES.&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;WRITE: 'Sum of all SALES:',&lt;/P&gt;&lt;P&gt;55 COMPANIES-SALES.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;WRITE: / COMPANIES-NAME, COMPANIES-PRODUCT,&lt;/P&gt;&lt;P&gt;55 COMPANIES-SALES.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we use At new for a field, it will trigger whenever there is any change in al lthe fields from the left to that of the particular field. But when we use On change of it triggers only when there is any change in the particular field. &lt;/P&gt;&lt;P&gt;At new can only be used inside loop. On change of can used outside the loop. &lt;/P&gt;&lt;P&gt;No logical Expressions can be added with at new. Logical expressions like AND OR can be used with on change of. &lt;/P&gt;&lt;P&gt;When AT NEW occurs, the alpha-numeric fields have * in their value,where as in case of On Change, the alphanumeric fields have their Corresponding value, of that particular record, where the Event gets fired. &lt;/P&gt;&lt;P&gt;On Change of executes for the first value of field too, this is not the case with At New.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On change of cannot be used in ABAP objects At new can be used in this.&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;Regards,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 12:51:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644374#M877594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T12:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: at command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644375#M877595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check the example for at last  and at end of commands..&lt;/P&gt;&lt;P&gt;REPORT ztest line-size 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:pa0002,&lt;/P&gt;&lt;P&gt;pa0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_pa0002 occurs 0,&lt;/P&gt;&lt;P&gt;pernr like pa0002-pernr,&lt;/P&gt;&lt;P&gt;begda like pa0002-begda,&lt;/P&gt;&lt;P&gt;endda like pa0002-endda,&lt;/P&gt;&lt;P&gt;vorna like pa0002-vorna,&lt;/P&gt;&lt;P&gt;nachn like pa0002-nachn,&lt;/P&gt;&lt;P&gt;end of it_pa0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_pa0008 occurs 0,&lt;/P&gt;&lt;P&gt;pernr like pa0008-pernr,&lt;/P&gt;&lt;P&gt;ansal like pa0008-ansal,&lt;/P&gt;&lt;P&gt;lga01 like pa0008-lga01,&lt;/P&gt;&lt;P&gt;bet01 like pa0008-bet01,&lt;/P&gt;&lt;P&gt;end of it_pa0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of it_final occurs 0,&lt;/P&gt;&lt;P&gt;C,&lt;/P&gt;&lt;P&gt;pernr like pa0002-pernr,&lt;/P&gt;&lt;P&gt;begda like pa0002-begda,&lt;/P&gt;&lt;P&gt;endda like pa0002-endda,&lt;/P&gt;&lt;P&gt;vorna like pa0002-vorna,&lt;/P&gt;&lt;P&gt;nachn like pa0002-nachn,&lt;/P&gt;&lt;P&gt;ansal like pa0008-ansal,&lt;/P&gt;&lt;P&gt;lga01 like pa0008-lga01,&lt;/P&gt;&lt;P&gt;bet01 like pa0008-bet01,&lt;/P&gt;&lt;P&gt;end of it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:s_pernr for pa0002-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select pernr&lt;/P&gt;&lt;P&gt;begda&lt;/P&gt;&lt;P&gt;endda&lt;/P&gt;&lt;P&gt;vorna&lt;/P&gt;&lt;P&gt;nachn&lt;/P&gt;&lt;P&gt;from pa0002&lt;/P&gt;&lt;P&gt;into table it_pa0002&lt;/P&gt;&lt;P&gt;where pernr in s_pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_pa0002 by pernr begda descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it_pa0002[] is initial.&lt;/P&gt;&lt;P&gt;select pernr&lt;/P&gt;&lt;P&gt;ansal&lt;/P&gt;&lt;P&gt;lga01&lt;/P&gt;&lt;P&gt;bet01&lt;/P&gt;&lt;P&gt;from pa0008&lt;/P&gt;&lt;P&gt;into table it_pa0008&lt;/P&gt;&lt;P&gt;for all entries in it_pa0002&lt;/P&gt;&lt;P&gt;where pernr = it_pa0002-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort it_pa0008 by pernr descending.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_pa0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_final-pernr = it_pa0002-pernr.&lt;/P&gt;&lt;P&gt;it_final-begda = it_pa0002-begda.&lt;/P&gt;&lt;P&gt;it_final-endda = it_pa0002-endda.&lt;/P&gt;&lt;P&gt;it_final-vorna = it_pa0002-vorna.&lt;/P&gt;&lt;P&gt;it_final-nachn = it_pa0002-nachn.&lt;/P&gt;&lt;P&gt;read table it_pa0008 with key pernr = it_pa0002-pernr .&lt;/P&gt;&lt;P&gt;it_final-ansal = it_pa0008-ansal.&lt;/P&gt;&lt;P&gt;it_final-lga01 = it_pa0008-lga01.&lt;/P&gt;&lt;P&gt;it_final-bet01 = it_pa0008-bet01.&lt;/P&gt;&lt;P&gt;append it_final.&lt;/P&gt;&lt;P&gt;clear it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_final.&lt;/P&gt;&lt;P&gt;write:/ SY-VLINE,&lt;/P&gt;&lt;P&gt;IT_FINAL-C AS CHECKBOX,&lt;/P&gt;&lt;P&gt;it_final-pernr color 1,&lt;/P&gt;&lt;P&gt;it_final-begda color 1,&lt;/P&gt;&lt;P&gt;it_final-endda color 1,&lt;/P&gt;&lt;P&gt;it_final-vorna color 1,&lt;/P&gt;&lt;P&gt;it_final-nachn color 1,&lt;/P&gt;&lt;P&gt;it_final-ansal color 1,&lt;/P&gt;&lt;P&gt;it_final-lga01 color 1,&lt;/P&gt;&lt;P&gt;it_final-bet01 color 1,&lt;/P&gt;&lt;P&gt;SY-VLINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of pernr.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;write:/ SY-VLINE,&lt;/P&gt;&lt;P&gt;14 'The annual salary of the employee is :' color 7 ,&lt;/P&gt;&lt;P&gt;118 it_final-ansal color 3,&lt;/P&gt;&lt;P&gt;162 SY-VLINE.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;at last.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;top-of-page.&lt;/P&gt;&lt;P&gt;write:/50 'THIS IS OFFICE MAX COMPANY' color 3.&lt;/P&gt;&lt;P&gt;write:/50 'THE EMPLOYEE TEST DATA FOR THIS COMPANY' color 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 12:51:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644375#M877595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T12:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: at command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644376#M877596</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;Check this thread&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3765027"&gt;&lt;/A&gt;&lt;/P&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>Thu, 17 Apr 2008 12:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-command/m-p/3644376#M877596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T12:51:39Z</dc:date>
    </item>
  </channel>
</rss>

