Application Development and Automation 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: 
Read only

Function to get Table indices

Former Member
0 Likes
888

Dear all,

i'm looking for a function modul to get indices of individuell table.

I could'nt dfinde any one!

best regards

7 REPLIES 7
Read only

vinod_vemuru2
Active Contributor
0 Likes
852

Hi,

I you can check the table DD12L for INDEX definitions of a table and DD12T for descriptions of indexes. Here pass the table name

Thanks,

Vinod.

Read only

0 Likes
852

Hi,

You can use FM " DB_GET_INDEXES'.

Regards,

Read only

0 Likes
852

Thank you very very much to all

ehmm @Gungor Ozcelebi

I get now all index fields from the FM. How can I determine the secondary indices.

I think its everything fields without '~0' right?

best regards

Edited by: handeglo on Jan 4, 2010 2:53 PM

Read only

0 Likes
852

you get the following tables in the FM.. right?

DBINDEXES

DBINDFLDS

in this DBINDEXES you have 1 field for index another for unique.. for primary key it would be 'X'.

or any ways the index <tab_name>~0 means primary key( ~0).

after getting this...

you delete the lines for <tab_name>~0 from DBINDFLDS and rest are your secondary keys

Read only

0 Likes
852

Yes, that's

Thank you again !

best regards

Read only

0 Likes
852

yes, ~0 is allways the primary index, all others are secondary.

Regards,

Clemens

Read only

Former Member
0 Likes
852

Hello

DD12L, DD12T, DD12V