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

Describe statement....

Former Member
0 Likes
976

What is the use od describe statement ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
918

Hi tushar,

DESCRIBE stmt is used to describe the attributes.

DESCRIBE FIELD - Describes the attributes of a field.

DESCRIBE LIST - Describes the attributes of a list.

DESCRIBE TABLE - Describes the attributes of the internal table.

Think of this scenario in dialog programming. While using Table control we need to find the number of lines , so that we can able to position our cursor for the deletion or updation of a record. To get the number of lines we use that Describe stmt.

Hope u understood. If my suggestion is valid, don't forget to award points.

Regards....

Arun.

8 REPLIES 8
Read only

Former Member
0 Likes
918

It returns the attributes of a field, intenal table.

Read only

0 Likes
918

So where does those returned attributes get stored ?

Read only

Former Member
0 Likes
918
Read only

Former Member
0 Likes
918

Hi,

If you use the DESCRIBE for an internal table..

DESCRIBE TABLE ITAB.

Then the number of the lines will be stored in

SY-TFILL.

Or you can directly a variable in the LINES addition.

DESCRIBE TABLE ITAB LINES V_LINES.

Thanks,

Naren

Read only

0 Likes
918

Can you give a simple example when we need to use it ?

Read only

0 Likes
918

DESCRIBE keyword is used to determine the attributes of a field, itab or a list at runtime ex:

DESCRIBE FIELD f length len type typ.

This will put the length of the field in the variable len & data type in typ.

DESCRIBE TABLE itab lines len occurs n.

This will put the number of lines of the itab in the variable len & the value of occurs parameter in variable n.

DESCRIBE LIST NUMBER OF LINES lin.

this Returns the number of lines in the list.

~Suresh

Read only

0 Likes
918

1. If you want to know the no of records in an internal table and to know internal tabe type ,

we use

DESCRIBE TABLE ITAB LINES V_LINES

TYPE V_TYPE.

DATA : V_LINES TYPE I.

now you can use V_LINES to print total no of records in that table.

V_TYPE to know the table is standard or sorted or hashed table.

2. FOR a FIELD

DESCRIBE FIELD V_FIELD LENGH V_LENGTH IN CHARACTER MODE.

to know the length of the variable (while defining) it will come to V_LENGTH.

Regards

srikanth

Read only

Former Member
0 Likes
919

Hi tushar,

DESCRIBE stmt is used to describe the attributes.

DESCRIBE FIELD - Describes the attributes of a field.

DESCRIBE LIST - Describes the attributes of a list.

DESCRIBE TABLE - Describes the attributes of the internal table.

Think of this scenario in dialog programming. While using Table control we need to find the number of lines , so that we can able to position our cursor for the deletion or updation of a record. To get the number of lines we use that Describe stmt.

Hope u understood. If my suggestion is valid, don't forget to award points.

Regards....

Arun.