10-22-2007 11:32 AM
10-22-2007 11:40 AM
Hi..
This FM return the List of Components in a Internal Table .
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = 'ZPRGM'
fieldname = 'IT_EKKO' "Internal table name
TABLES
components = it_components.
REWARD IF HELPFUL.
10-22-2007 11:40 AM
Hi,
The function module GET_COMPONENT_LIST does exactly what you wish.
Imagine that you want to get all the fields of an internal table named itab. This itab is defined in the program named 'ZPRGM', and a line of this itab is called work_area.
That is to say, you have a program like this :
Code:
REPORT zprgm.
(...)
Internal table
DATA : begin of itab occurs 0,
f1(5) type c,
f2(15) type c,
f3 type matnr,
end of itab.
Buffer
DATA : work_area LIKE LINE OF itab.
(...)
To get the name of the fields of this itab, you have to do the following :
Code:
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = 'ZPRGM'
fieldname = 'WORK_AREA'
TABLES
components = it_components.
In it_components, you will have many information on your internal table fields.
Be careful : WORK_AREA must have been defined as a global data in ZPRGM program.
Hope this helps.
You can check this from
http://www.sapfans.com/forums/viewtopic.php?=&p=832254
regards,
Omkar.
10-22-2007 11:40 AM