Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

function module

Former Member
0 Kudos

Hi,

What is the use of function module 'GET_COMPONENT_LIST'?

3 REPLIES 3

varma_narayana
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

Check this.

Thanks,

Muthu.