<?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: Year wise data for an Archiving object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847891#M1133823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, my select Query doesn't have a Where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  CLEAR gwa_znrows_def.
  LOOP AT gt_znrows_def INTO gwa_znrows_def.

* Check whether the entry is Active or not !
    IF gwa_znrows_def-ractive = 'X'.

  CREATE DATA gt_table TYPE TABLE OF (gwa_znrows_def-son).

  ASSIGN gt_table-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.

  SELECT * FROM (gwa_znrows_def-son) INTO TABLE &amp;lt;fs_table&amp;gt; ORDER BY PRIMARY KEY.

* Get the filedname which is having YEAR/Date
  gv_date_field = gwa_znrows_def-fieldname.

* Sort
  SORT &amp;lt;fs_table&amp;gt; BY (gv_date_field) DESCENDING.

* Year wise data
  LOOP AT &amp;lt;fs_table&amp;gt; ASSIGNING &amp;lt;wa_table&amp;gt;.
    AT END OF (gv_date_field).
" Cumulate the Year wise data and get the total number of records (Help needed here ! )
    ENDAT.
  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Dec 2008 13:45:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-01T13:45:33Z</dc:date>
    <item>
      <title>Year wise data for an Archiving object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847889#M1133821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my scenario --&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have an Archiving Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. There will be many DB Tables which are linked to this Archiving Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Now I want the Year wise data of these DB Tables of that particular Archiving Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. I've created a dynamic internal table to fetch the data from the DBTs depending upon the Archiving Object specified on the SSCRN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Now in my Dynamic Internal Table say I have the content from DBT MSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Now, in MSEG there will be a field MJAHR for the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. So depending upon the values of this MJAHR Field I need to group my internal table data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. In some other cases the DBT may be BSEG. In this case the date field will be GJAHR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. In this case the internal table data should be grouped by the GJAHR Field values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10. So, now my Question is : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you group your internal table content Year wise in this dynamic internal table content scenario?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I'm clear in explaining my scenario !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 11:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847889#M1133821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-01T11:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Year wise data for an Archiving object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847890#M1133822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i Understood, your query should be like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select * into corresponding fields of table &amp;lt;dyn_table&amp;gt;&lt;/P&gt;&lt;P&gt;             from (db_table)&lt;/P&gt;&lt;P&gt;            where (v_where).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your invoking the tables from the archiving object and inserting into this kind of Query based on the specified condition like GJHAR/ MJAHR etc in the WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u already built the dyn_itab for the db table. so in the where clause u can write like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; v_where = '&amp;amp; = ''&amp;amp;'' '.&lt;/P&gt;&lt;P&gt;REPLACE '&amp;amp;' WITH field_name INTO v_where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 13:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847890#M1133822</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2008-12-01T13:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Year wise data for an Archiving object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847891#M1133823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, my select Query doesn't have a Where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  CLEAR gwa_znrows_def.
  LOOP AT gt_znrows_def INTO gwa_znrows_def.

* Check whether the entry is Active or not !
    IF gwa_znrows_def-ractive = 'X'.

  CREATE DATA gt_table TYPE TABLE OF (gwa_znrows_def-son).

  ASSIGN gt_table-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.

  SELECT * FROM (gwa_znrows_def-son) INTO TABLE &amp;lt;fs_table&amp;gt; ORDER BY PRIMARY KEY.

* Get the filedname which is having YEAR/Date
  gv_date_field = gwa_znrows_def-fieldname.

* Sort
  SORT &amp;lt;fs_table&amp;gt; BY (gv_date_field) DESCENDING.

* Year wise data
  LOOP AT &amp;lt;fs_table&amp;gt; ASSIGNING &amp;lt;wa_table&amp;gt;.
    AT END OF (gv_date_field).
" Cumulate the Year wise data and get the total number of records (Help needed here ! )
    ENDAT.
  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2008 13:45:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/year-wise-data-for-an-archiving-object/m-p/4847891#M1133823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-01T13:45:33Z</dc:date>
    </item>
  </channel>
</rss>

