<?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: System fields affected by AT FIRST/LAST statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069911#M1177969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Before u loop, u have to sort the internala table ..dis is a prerequisite to use AT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In u ITAB structure,which field u r trying to use in AT statement...y becoz..it takes all of the fields before to that are take it as keyfields..thats y u r getting ****.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dats y it is printing  the left values and right values as *****.Check u t internal table structure..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kiran Saka on Feb 9, 2009 6:44 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kiran Saka on Feb 9, 2009 6:45 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Feb 2009 05:44:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-09T05:44:36Z</dc:date>
    <item>
      <title>System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069906#M1177964</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;&lt;/P&gt;&lt;P&gt;1. Which system fields are affected when i use the key word AT FIRST/ AT LAST / AT NEW / AT END ?? [Similar to sy-subrc is affected after a select query]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I am trying to print a variable (work area field) in AT statement.  The WRITE statement prints ***** instead of the content in the work area fields . Why is it so??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at it_customers into wa_customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;Write:/ 'Inside First Block'.&lt;/P&gt;&lt;P&gt;Write:/ wa_customers-ID , wa-customers-name.&lt;/P&gt;&lt;P&gt;ENDAT.&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;-Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:37:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069906#M1177964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069907#M1177965</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;Try this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wheb you use the AT FIRST/LAST events the fields after the fields you specifed in the AT FIRST/LAST Event will have the stars in it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't specify fields in the AT FIRST/LAST event then all the fields in the header line have the stars in it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To overcome this move the values to the variable as show in the below example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : g_customers like wa_customers.

LOOP at it_customers into wa_customers.

MOVE wa_customers TO g_customers.

AT FIRST.
Write:/ 'Inside First Block'.
Write:/ g_customers-ID , g_customers-name.
ENDAT.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Avinash Kodarapu on Feb 9, 2009 11:10 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:40:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069907#M1177965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069908#M1177966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;in at new and at change of the wa_itab will not save the contents of the fields of it's right side.&lt;/P&gt;&lt;P&gt;so it is better to use an other work area. and before at new or at change make like this.&lt;/P&gt;&lt;P&gt; wa_itab2 = wa_itab1&lt;/P&gt;&lt;P&gt;append wa_itab2  to itab2.&lt;/P&gt;&lt;P&gt;then perform the functionality of at new or else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069908#M1177966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069909#M1177967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. sy-subrc will work not only for select but for all statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If you are using control break statement at new will not show record values on right side.&lt;/P&gt;&lt;P&gt;   For that you have to define another internal table and move the data to it and display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069909#M1177967</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-02-09T05:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069910#M1177968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In Control Statements (AT) if there are any character field at the right after the field in AT it will appear as *** and Integer as ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to print these value capture the value of sy-tabix in the At and print the value outside ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will resolve teh issue..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Internal Table should be always sorted.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069910#M1177968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069911#M1177969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Before u loop, u have to sort the internala table ..dis is a prerequisite to use AT statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In u ITAB structure,which field u r trying to use in AT statement...y becoz..it takes all of the fields before to that are take it as keyfields..thats y u r getting ****.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dats y it is printing  the left values and right values as *****.Check u t internal table structure..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kiran Saka on Feb 9, 2009 6:44 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kiran Saka on Feb 9, 2009 6:45 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:44:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069911#M1177969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069912#M1177970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In AT First and AT last statement you will not get the values of the work area completely they will have only initial values for all numeric fields and * for character fields....&lt;/P&gt;&lt;P&gt;In AT new &amp;lt;field_name&amp;gt; and AT end of &amp;lt;field_name&amp;gt;  will take the values of all the left fields of the field_name and all the fields which are at right of the field_name will take the initial values....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so to get the values of these fields in the at events.... please use the code mentioned below,&lt;/P&gt;&lt;P&gt;I am taking a new wa  which is similar to the wa you have used and assigning its value in the loop and then use at events....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wa_customers1 like wa_customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at it_customers into wa_customers.&lt;/P&gt;&lt;P&gt;wa_customers1 = wa_customers.&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;Write:/ 'Inside First Block'.&lt;/P&gt;&lt;P&gt;Write:/ wa_customers1-ID , wa-customers1-name.&lt;/P&gt;&lt;P&gt;ENDAT.&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;&lt;/P&gt;&lt;P&gt;this works,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:44:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069912#M1177970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069913#M1177971</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;in type declearation...&lt;/P&gt;&lt;P&gt;put the field which you want to display before the field you specify in at first &amp;lt;field&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at first or at last donot effect system field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. if you are specifying a field name in at first and you are trying to write any other field of type c and which come after the field in at first.....then inside at first and endat it will give ***** and for filed of type numeric it will give zeros..&lt;/P&gt;&lt;P&gt;whst you can do is to change the order in which the field exist in type definition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mohit Kumar on Feb 9, 2009 6:45 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:44:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069913#M1177971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069914#M1177972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This ***** are not because of system fields problem with Control break statements.&lt;/P&gt;&lt;P&gt;If your table having 5 fileds and  you are doing AT New  of FLD3 ( Third field ) then fld4 and fld 5 will be coming like *****  ( Stars ) or  spaces ( '     ' ) according to their data types .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid that you can either      write any function like &lt;STRONG&gt;SUM&lt;/STRONG&gt;  in the at new block   or write the fields which are right sided fields of specified field in the At New ( In my example FLD4  &amp;amp; fld 5 )  out of the loop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;loop at .........&lt;/P&gt;&lt;P&gt;at new fld 3 .&lt;/P&gt;&lt;P&gt;write : / fld1, fld2 , fld.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;write fld4 , fld5 .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at .........&lt;/P&gt;&lt;P&gt;at new fld 3 .&lt;/P&gt;&lt;P&gt;sum. &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;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069914#M1177972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: System fields affected by AT FIRST/LAST statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069915#M1177973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Wheb you use the AT FIRST/LAST events the fields after the fields you specifed in the AT FIRST/LAST Event will have the stars in it.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do not use any fields after AT FIRST/LAST stmts &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 06:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-fields-affected-by-at-first-last-statement/m-p/5069915#M1177973</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-02-09T06:00:35Z</dc:date>
    </item>
  </channel>
</rss>

