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: 

describe table table_name lines var

Former Member
0 Kudos

Hi Gurus,

In the internal table has 1 records, but only few fields are pouplated, While DESCRIBE statement its not showing the number of records, its a upgrade project from 4.6c to ECC 6.0

data: var type sy-tfill.

describe table table-name lines var.

if var gt 0.

......

reward asured.

with regards

Thambee.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Thambe Durai,

I thing you did not append that record.

See this example code

data:

begin of itab occurs 10,

num type i,

name(20),

end of itab.

data num type i.

itab-name = 'Mahi'.

append itab.

describe table itab lines num.

write num.

Plzz reward if it is useful,

Mahi.

3 REPLIES 3

Former Member
0 Kudos

Hi Thambe Durai,

I thing you did not append that record.

See this example code

data:

begin of itab occurs 10,

num type i,

name(20),

end of itab.

data num type i.

itab-name = 'Mahi'.

append itab.

describe table itab lines num.

write num.

Plzz reward if it is useful,

Mahi.

learnsap
Active Participant
0 Kudos

Hi,

Can you give the code, so that we might suggest some thing on that...

Regards,

Ramesh

Former Member
0 Kudos

hi Durai..

while there is only one record populated to an internal table via select statement it would be available only in a workarea. so the DESCRIBE stmt is not calculating the no. of records.

so try to append it to the body.

Try like this sample code..,

data: var type sy-tfill.

DATA: ITAB LIKE ZDB_EMP OCCURS 0 WITH HEADER LINE.

SELECT * FROM ZDB_EMP INTO ITAB WHERE EMPID = '111'.

ENDSELECT.

APPEND ITAB. " put this append stmt

describe table ITAB lines var.

if var gt 0.

WRITE: / VAR.

ENDIF.

Regards,

K.Tharani.