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 module for Table field Attributes

Former Member
0 Likes
1,285

HI

is there any Function Module which will return the table attributes.

Eg Table - MARA

Field Matnr

I need datatype, field length, decimal etc.

Thanks

Sridhar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
757

Hi,

Use this function module:

C14Z_TABLE_INFO_GET

Regards,

Shailaja

5 REPLIES 5
Read only

Former Member
0 Likes
757

try using the RTTI class CL_ABAP_STRUCTDESCR.

sample code is as below

data lo_structdescr type ref to cl_abap_structdescr.

data lv_type type string.

lv_type = 'SFLIGHT'.

LO_STRUCTDESCR ?= CL_ABAP_structDESCR=>DESCRIBE_BY_name( P_name = LV_TYPE ).

lt_components = lo_structdescr->get_components( )

lt_components wil lcontain the field names as well as the other details

Read only

0 Likes
757

Hi Piyush

Thanks for your reply but

It is returning Field name and type reference

eg

fieldname - MANDT

Type reference - "->"

m also need data type short desc length etc.

Sridhar

Read only

Former Member
0 Likes
758

Hi,

Use this function module:

C14Z_TABLE_INFO_GET

Regards,

Shailaja

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
757

ISB_TABLE_READ_FIELDS

check this FM

Read only

Former Member
0 Likes
757

Hi,

Try this FM,

DDIF_NAMETAB_GET

Duplicate thread:

Regards

Adil