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 to get Key field of a table

Former Member
0 Kudos

How can I get if a field of a table is a key field?

Can you suggest a FM?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Salvatore,

You can acess the table DD03L with the tablename and in the field KEYFLAG = 'X' , you'll know which field is a key field .

Best regards,

Aline Martins

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Simple check table DD03L field KEYFLAG will be fill if it is key field.

Regards,

Rich Heilman

Former Member
0 Kudos

u can try this

CLCV_GET_KEY_FIELD

Rewards if helpful

Viky

Former Member
0 Kudos

Hello Salvatore,

You can acess the table DD03L with the tablename and in the field KEYFLAG = 'X' , you'll know which field is a key field .

Best regards,

Aline Martins

Former Member
0 Kudos

here is still a good one(FM)

CUTA_DD_TABLE_KEYFIELDS_GET

Viky

ferry_lianto
Active Contributor
0 Kudos

Hi Salvatore,

You can use FM DDIF_FIELDINFO_GET and then loop at DFIES_TAB where KEYFLAG = 'X' to get all key field(s) of the table.

Hope this will help.

Regards,

Ferry Lianto