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

best replace for DESCRIBE TABLE

former_member306083
Participant
0 Likes
31,249

Friends,

It seems that the instruction DESCRIBE TABLE will be obsolete, I had trying with get the same functionality with RTTS without success. It's possible to do it with RTTS? I can’t find in these classes some attribute for the number of lines of tables.

Thanks.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
15,031

HI. I believe that you can do the same thing as the DESCRIBE statement for getting the number of lines with the code below.



data: itab type table of spfli.
data: lv_lines type i.

lv_lines = lines( itab ).

Regards,

RIch Heilman

Friends,

It seems that the instruction DESCRIBE TABLE will be obsolete, I had trying with get the same functionality with RTTS without success. It's possible to do it with RTTS? I can’t find in these classes some attribute for the number of lines of tables.

Thanks.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
15,032

HI. I believe that you can do the same thing as the DESCRIBE statement for getting the number of lines with the code below.



data: itab type table of spfli.
data: lv_lines type i.

lv_lines = lines( itab ).

Regards,

RIch Heilman

Read only

0 Likes
15,031

Hi Rich,

Thanks for the info ... something new to learn.

Regards,

Ferry Lianto

Read only

15,031

Yep, I thought it was quite cool when I first discovered it. Much better than using the DESCRIBE statement. You can also use this in an IF statement like this.

If  lines( itab ) > 0.

*  Do Something

Endif.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
15,031

It rely on the version. if the version is low ,the statement cann`t be used!

for example my version is 4.6c