‎2008 Dec 01 11:27 AM
Dear All,
Here is my scenario -->
1. I have an Archiving Object.
2. There will be many DB Tables which are linked to this Archiving Object.
3. Now I want the Year wise data of these DB Tables of that particular Archiving Object.
4. I've created a dynamic internal table to fetch the data from the DBTs depending upon the Archiving Object specified on the SSCRN.
5. Now in my Dynamic Internal Table say I have the content from DBT MSEG.
6. Now, in MSEG there will be a field MJAHR for the date.
7. So depending upon the values of this MJAHR Field I need to group my internal table data.
8. In some other cases the DBT may be BSEG. In this case the date field will be GJAHR.
9. In this case the internal table data should be grouped by the GJAHR Field values.
10. So, now my Question is :
How do you group your internal table content Year wise in this dynamic internal table content scenario?
Hope I'm clear in explaining my scenario !
Any help is appreciated !
Thanks & regards,
Deepu.K
‎2008 Dec 01 1:39 PM
Hi Deepu,
If i Understood, your query should be like:
select * into corresponding fields of table <dyn_table>
from (db_table)
where (v_where).
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.
u already built the dyn_itab for the db table. so in the where clause u can write like
v_where = '& = ''&'' '.
REPLACE '&' WITH field_name INTO v_where.
thanks
mahesh
‎2008 Dec 01 1:45 PM
Hello Mahesh,
Thanks for the reply !
But, my select Query doesn't have a Where clause.
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->* TO <fs_table>.
SELECT * FROM (gwa_znrows_def-son) INTO TABLE <fs_table> ORDER BY PRIMARY KEY.
* Get the filedname which is having YEAR/Date
gv_date_field = gwa_znrows_def-fieldname.
* Sort
SORT <fs_table> BY (gv_date_field) DESCENDING.
* Year wise data
LOOP AT <fs_table> ASSIGNING <wa_table>.
AT END OF (gv_date_field).
" Cumulate the Year wise data and get the total number of records (Help needed here ! )
ENDAT.
ENDLOOP.
Any clues ?
Regards,
Deepu.K
..