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: 

How can I list all the column names of a table dynamically by programming?

Former Member
0 Kudos

Hi,

Now I want to write an function using ABAP which has the following features:

Firstly, The function was given a parameter as table name.

Then, it will lists all the columns names of the table.

e.g

table: person

---firstName------lastName----+

Michale Jackson

.... ....

We can get the columns 'firstname' and 'lastName' by calling the function with table name 'person'.

And I also wonder that where I can get reference book or any other materials?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi, You need not create an explicit function for field name descriptions. SAP internally has quite few FM's for the same. One FM is: C14Z_TABLE_INFO_GET Once executed you can find the descriptions in following fields of the internal table

DDTEXT
REPTEXT
SCRTEXT_S
SCRTEXT_M
SCRTEXT_L

2 REPLIES 2

Former Member
0 Kudos

Hi

No need to write any Function..U can get same feature by using

RFC_READ_TABLE

Just write the Field names from table FIELDS ae per ur reqmt..

Hope it helps.

Praveen

Former Member
0 Kudos

Hi, You need not create an explicit function for field name descriptions. SAP internally has quite few FM's for the same. One FM is: C14Z_TABLE_INFO_GET Once executed you can find the descriptions in following fields of the internal table

DDTEXT
REPTEXT
SCRTEXT_S
SCRTEXT_M
SCRTEXT_L