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 Find the Data Type of the Field In a Database Table

Former Member
0 Kudos

Hi Experts,

I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It would be helpful if a demo example could be provided.

Thanks a lot.

1 ACCEPTED SOLUTION

Simha_
Employee
Employee
0 Kudos

Hi,

Use this..

DESCRIBE FIELD dobj TYPE typ.

write typ.

type will contain the data type of the object.

and check this thread also....

Cheers,

Simha.

Reward all the helpful answers..

5 REPLIES 5

Former Member
0 Kudos

are you looking for this

REPORT  YCHATEST.

DATA : V_MATNR LIKE MARA-MATNR,
       V_TYPE(5).

DESCRIBE FIELD V_MATNR TYPE V_TYPE.

WRITE : V_TYPE.

Simha_
Employee
Employee
0 Kudos

Hi,

Use this..

DESCRIBE FIELD dobj TYPE typ.

write typ.

type will contain the data type of the object.

and check this thread also....

Cheers,

Simha.

Reward all the helpful answers..

Former Member
0 Kudos

Thanks for your reply, however my code needs to support the dynamically specified table name and field name. Therefore I'm not sure if your code works.

Former Member
0 Kudos

hi

use the following code

<b>data:datatype LIKE dd03l-datatype.

SELECT fieldname position keyflag datatype

INTO TABLE ifield

FROM dd03l

WHERE tabname = tabname

AND fieldname NOT LIKE '.INCLU%'

ORDER BY position</b>.

regards

ravish

<b>plz reward points if helpful</b>

Former Member
0 Kudos

Hi,

Check the following link:

http://www.sapbrain.com

Regards,

Bhaskar