<?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: Simple ABAP? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796282#M342192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;write: / wa-TRFGB,&lt;/P&gt;&lt;P&gt;          10 wa-ENDDA,&lt;/P&gt;&lt;P&gt;          30 wa-BEGDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;write: / wa-TRFGB,&lt;/P&gt;&lt;P&gt;          10 wa-ENDDA,&lt;/P&gt;&lt;P&gt;          30 wa-BEGDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2006 12:13:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-07T12:13:47Z</dc:date>
    <item>
      <title>Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796263#M342173</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;&lt;/P&gt;&lt;P&gt;I have an interbal table and I wnt to read the first and the last recod from the table based on the entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRFGB	ENDDA	BEGDA&lt;/P&gt;&lt;P&gt;4A	20040131	20030201&lt;/P&gt;&lt;P&gt;4A	20050131	20040201&lt;/P&gt;&lt;P&gt;4A	20050504	20050201&lt;/P&gt;&lt;P&gt;4A	99991231	20050505&lt;/P&gt;&lt;P&gt;ZB	20020131	20011231&lt;/P&gt;&lt;P&gt;ZB	20020615	20020201&lt;/P&gt;&lt;P&gt;ZB	20030131	20020616&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my output should be..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRFGB	ENDDA	BEGDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4A          99991231  20030201&lt;/P&gt;&lt;P&gt;ZB         20030131   20011231&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant use 2nd table.&lt;/P&gt;&lt;P&gt;Please help me with a code.....&lt;/P&gt;&lt;P&gt;thanxx in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:33:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796263#M342173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796264#M342174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;for all the records u need the first and last record? what exactly u need? why dont u choose the record with some condition?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796264#M342174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796265#M342175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for all TRFGR field I need 1st BEGDA and last ENDDA.. can u gve code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796265#M342175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796266#M342176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.  If TRFGB is your first field of internal table then,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB by TRFGB ENDDA BEGDA.&lt;/P&gt;&lt;P&gt;LOOP AT ITB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;  ON-CHANGE OF ITAB-TRFGB.&lt;/P&gt;&lt;P&gt;  NEWITAB = ITAB.&lt;/P&gt;&lt;P&gt;  APPEND NEWITAB.&lt;/P&gt;&lt;P&gt;  ENDON.&amp;lt;/b&amp;gt;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796266#M342176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796267#M342177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DESCRIBE TABLE itab LINES len.

IF len GT 0.
* For First record
Read table itab into wa index 1.

* For last record
Read table itab into wa index len.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhupal Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:44:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796267#M342177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796268#M342178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Declare variable &lt;/P&gt;&lt;P&gt;"data : var type i.&lt;/P&gt;&lt;P&gt;   Describe table itab lines var."  &lt;/P&gt;&lt;P&gt;Now  you will get the total no. of records in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;decalre internal table  itab1  which is having same structure like itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab where index = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   append lines of itab to itab1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; " Here you will get your column names  like  TRFGB ENDDA BEGDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab where index = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   append lines of itab to itab1. &lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;" Here you will get first data row  like 4A 99991231 20030201.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab where index = var.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   append lines of itab to itab1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Here you will get first data row  like  ZB 20030131 20011231&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls. reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:44:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796268#M342178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796269#M342179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the following code, change the field names &amp;amp; table names as you require.&lt;/P&gt;&lt;P&gt; instead of pernr u can use TRFGB &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;        pernr like pa0000-pernr,&lt;/P&gt;&lt;P&gt;        endda like pa0000-endda,&lt;/P&gt;&lt;P&gt;        begda like pa0000-begda,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_pernr like pa0000-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select pernr max( endda ) min( begda )&lt;/P&gt;&lt;P&gt;       from pa0000 into table itab&lt;/P&gt;&lt;P&gt;       where pernr = p_pernr&lt;/P&gt;&lt;P&gt;       group by pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/ itab-pernr, itab-endda, itab-begda.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:51:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796269#M342179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796270#M342180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u may want to do a f1 help on the keywords&lt;/P&gt;&lt;P&gt;"at first" and "at last".. which are commonly used to process data within internal table loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;P&gt;abap newbie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796270#M342180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796271#M342181</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;Here itab is the second tble which should be output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab1 by trfgb begda.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;*Preparing endda for second table&lt;/P&gt;&lt;P&gt;       wa-endda = wa1-endda.&lt;/P&gt;&lt;P&gt;*CHecking for highest endda&lt;/P&gt;&lt;P&gt;       loop at itab1 into wa2 where trfgb = wa1-trfgb and endda &amp;gt; wa1-endda.&lt;/P&gt;&lt;P&gt;             if wa2-endda &amp;gt; wa-endda.&lt;/P&gt;&lt;P&gt;                wa-endda = wa2-endda.&lt;/P&gt;&lt;P&gt;             endif.&lt;/P&gt;&lt;P&gt;       endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Getting other fields for second table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       wa-trfda = wa1-trfda.&lt;/P&gt;&lt;P&gt;       wa-begda = wa1-bedga.&lt;/P&gt;&lt;P&gt;      append wa to itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;write : / wa.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.If so,kindly reward points by clicking the star on the left of reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:56:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796271#M342181</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-07T07:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796272#M342182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab.
  at first.
    write: / itab-TRFGB, itab-ENDDA, itab-BEGDA.
  endat.

  at last.
    write: / itab-TRFGB, itab-ENDDA, itab-BEGDA.
  endat.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796272#M342182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796273#M342183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay , &lt;/P&gt;&lt;P&gt; Since you dont want to create a new internal table , i.e. you just want to print the data from your internal table .&lt;/P&gt;&lt;P&gt;here is a code which worked for me&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
tYPES : Begin of ty_1 ,
          str type string ,
          begda type datum ,
          endda type datum ,
         end of ty_1.
Data : it_1 type table of ty_1 ,
      wa_1 type  ty_1,
      WA_2 TYPE TY_1.
start-of-selection.
wa_1-str = 'ABC'.
wa_1-begda = '20061101'.
wa_1-endda = '20061102'.
append wa_1 to it_1.
wa_1-str = 'ABC'.
wa_1-begda = '20061103'.
wa_1-endda = '20061104'.
append wa_1 to it_1.
wa_1-str = 'ABC'.
wa_1-begda = '20061105'.
wa_1-endda = '20061106'.
append wa_1 to it_1.

wa_1-str = 'DEF'.
wa_1-begda = '20061101'.
wa_1-endda = '20061102'.
append wa_1 to it_1.

  wa_1-str = 'DEF'.
wa_1-begda = '20061105'.
wa_1-endda = '20061106'.
append wa_1 to it_1.

wa_1-str = 'DEF'.
wa_1-begda = '20061103'.
wa_1-endda = '20061104'.
append wa_1 to it_1.



SORT IT_1 BY STR BEGDA ENDDA.
LOOP AT IT_1 INTO WA_1.
WA_2 = WA_1.
* At new STR , prnit the STR and the smallest date
AT NEW STR.
  WRITE:/ WA_1-STR , WA_2-BEGDA.
ENDAT.
* At eend of that STR print the largest date
AT END OF STR.
WRITE WA_2-ENDDA.
ENDAT.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796273#M342183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796274#M342184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried as u said but when I use at new and at end of..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the date field is displayed as *******.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:36:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796274#M342184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796275#M342185</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;Did you tried my suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:40:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796275#M342185</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-07T08:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796276#M342186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay , &lt;/P&gt;&lt;P&gt;  If you look at my code the next line after loop at .... is &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;WA_2 = WA_1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;. This is required because whenyou use At..... , the all fields after the field mentioned in the AT command get converted to ***.&lt;/P&gt;&lt;P&gt;So please add one more line , in which you move the content of your header/workare to another one and the use this for printing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you still have problems please paste your code for this section and i shall try to figure out what is the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Please reward with point if ans is helpful&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796276#M342186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796277#M342187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i understand you want to display the entries on change of the first field.&lt;/P&gt;&lt;P&gt;Plz try the following code..&lt;/P&gt;&lt;P&gt;after sorting the internal table ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : wa_itab like line of itab,&lt;/P&gt;&lt;P&gt;          lv_index type i ,&lt;/P&gt;&lt;P&gt;          lv_index_mod type i,&lt;/P&gt;&lt;P&gt;          lv_count type i  value 0 ,      " Zero / initial value&lt;/P&gt;&lt;P&gt;          lv_lines type i.&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;Sort itab by TRFGB .&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE itab LINES lv_lines.&lt;/P&gt;&lt;P&gt;lv_index-mod = 1 .&lt;/P&gt;&lt;P&gt;Loop at itab  into wa_itab.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;        lv_index = sy-tabix.&lt;/P&gt;&lt;P&gt;        Check lv_index GT 1.&lt;/P&gt;&lt;P&gt;         AT END OF TRFGB.&lt;/P&gt;&lt;P&gt;              READ TABLE itab into wa_itab  INDEX lv_index_mod &lt;/P&gt;&lt;P&gt;                        Transporting BEGDA.&lt;/P&gt;&lt;P&gt;              ADD 1 to lv_count.&lt;/P&gt;&lt;P&gt;              MODIFY  itab  from  wa_itab INDEX lv_count.&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt;              IF lv_index  LT lv_lines.&lt;/P&gt;&lt;P&gt;                 lv_index_mod = lv_index + 1.&lt;/P&gt;&lt;P&gt;              ENDIF.&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;ADD 1 to lv_count.&lt;/P&gt;&lt;P&gt;DELETE itab from lv_count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at  itab into wa_itab.&lt;/P&gt;&lt;P&gt;     WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; wa_itab-TRFGB , wa_itab-ENDDA , wa_itab-BEGDA.&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;i hope the above code snippet helps you .&lt;/P&gt;&lt;P&gt;if u still face some issues plz revert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Plz award points for helpfull answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796277#M342187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796278#M342188</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;I'm not sure what you want actually.&lt;/P&gt;&lt;P&gt;but, if u use at new and at end.&lt;/P&gt;&lt;P&gt;the way you position the fields in your itab is important...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using at new (field1)... it checks for the current row in the itab and if the value in field1 in the current row is different from the value of field1 in previous row... it process.. else skip process..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;those field2, field3...etc in your itab would be displayed as *****...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are 2 ways to solve this:&lt;/P&gt;&lt;P&gt;1) position your field1 in the last row of your itab&lt;/P&gt;&lt;P&gt;2) use flag technique...&lt;/P&gt;&lt;P&gt;eg. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: flag.

loop at itab.
at new field1.
write: / itab-field1.
flag = 'X'.
endat.
check flag = 'X'.
write: itab-field2, itab-field3.....
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; remember to sort your itab accordingly...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796278#M342188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796279#M342189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;first u sort the table by ascending.&lt;/P&gt;&lt;P&gt;sort table ascending by TRFGB BEGDA ENDDA.&lt;/P&gt;&lt;P&gt;read table itab index 1 into wa.&lt;/P&gt;&lt;P&gt;assign the required fields to variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next sort table descending by TRFGB ENDDA BEGDA&lt;/P&gt;&lt;P&gt;and do the same steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 09:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796279#M342189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T09:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796280#M342190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Abhay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you need the latest entry both by ENDDA and BEGDA, you can try the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT &amp;lt;internal table&amp;gt; BY trfgb endda DESCENDING begda DESCENDING.&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM &amp;lt;internal table&amp;gt; COMPARING trfgb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SORT statement is to sort the table in descending order of both endda and begda. The delete statements deletes the unnecessary values of trfgb, except the latest entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijaya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 09:04:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796280#M342190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T09:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796281#M342191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have given an example ,hope it helps you .&lt;/P&gt;&lt;P&gt;****************************************************************************&lt;/P&gt;&lt;P&gt;tables mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_mara  type TABLE OF makt,  "internal table of type makt&lt;/P&gt;&lt;P&gt;         wt_mara type makt                 .  "work area of type makt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;selects all records for the field spras &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;form makt such that matnr is less than 88&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;select spras &lt;/P&gt;&lt;P&gt;from makt into corresponding fields of table it_mara &lt;/P&gt;&lt;P&gt;where matnr le '000000000000000088'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_mara into wt_mara .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;writes only if it is the first record of the internal table .  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if  sy-tabix EQ 1. " sy-tabix is the sys field ,which has the index of internal table &lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; wt_mara-spras.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;****do not clear the contents of work area here because the work area contains the last *****record processed but usually it is suggested to clear the work area .&lt;/P&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; wt_mara-spras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="81" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 09:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796281#M342191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T09:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simple ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796282#M342192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST.&lt;/P&gt;&lt;P&gt;write: / wa-TRFGB,&lt;/P&gt;&lt;P&gt;          10 wa-ENDDA,&lt;/P&gt;&lt;P&gt;          30 wa-BEGDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;write: / wa-TRFGB,&lt;/P&gt;&lt;P&gt;          10 wa-ENDDA,&lt;/P&gt;&lt;P&gt;          30 wa-BEGDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 12:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-abap/m-p/1796282#M342192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T12:13:47Z</dc:date>
    </item>
  </channel>
</rss>

