This is a test message to test the length of the message box.
Login
ABAP Obsolete Describe
Created by Software-Heroes

ABAP Obsolete - DESCRIBE

1602

Again we have for you a most used ABAP term for which there is already a new alternative, this time not just one alternative.



In today's article we want to give you a closer look at the changes to DESCRIBE. The peculiarity of this command is that it depicts several functions and is not just for one thing. For example, you can specify the type of table or the number of rows in a table. We'll show you how the latest features can be used.

 

Turn one into three

Basically, an existing command is replaced by several new techniques and commands, so why so many innovations? In order to clearly distinguish the functions from each other, Describe is officially not yet marked as obsolete. These features include:

  • Properties of a field
  • Properties of a table
  • Properties between two fields

 

Number of table rows

To derive the number of lines, an inline function can now be used which directly returns a number and can be called in a concatenation. Here's a little example from everyday life for you:


" with describe
DESCRIBE TABLE lt_t001 LINES DATA(ld_lines).
WRITE: / |Number of company codes: { ld_lines }|.

" new variant 
WRITE: / |Number of company codes: { lines( lt_t001 ) }|.

 

As you can see, you can now concatenate the calls as known in Modern ABAP. The inline declaration works as well as with the Describe command.

 

Derive properties

For the derivation of the data types and properties, there are the RTTS services in the system. This is a bundle of classes to which you can pass a variable and it return an object that holds more information about the properties of this variable.

We will prepare more about the RTTS services in a separate article and give you a closer look at several examples.

 

Conclusion

Although DESCRIBE is not quite obsolete yet, you can already use many new features that save time and are much more intuitive to use. We definitely recommend the uses of the more advanced features.

 

Source:
ABAP Documentation - Describe
ABAP Documentation - Lines


Included topics:
ObsoleteDESCRIBE
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


ABAP - Naming conventions

Category - ABAP

How important is it nowadays to adhere to naming conventions or even to use naming conventions in the modern ABAP environment? We want to look at that in this article.

04/09/2021

ABAP - Use INSERT

Category - ABAP

APPEND already has a long history in ABAP, but this will play less and less of a role in the future. We'll show you why.

12/11/2020

ABAP Obsolete - Assignment and calculation

Category - ABAP

How does it actually work with the assignments and the calculation in ABAP? Here you will find out the current language constructs and what you should avoid.

06/26/2020

ABAP Obsolete - Ranges and Headers

Category - ABAP

Generate a decent range for an interface? Tables with or without header lines? We show you what is still possible and what you should rather be.

06/12/2020

ABAP Obsolete - TYPE-POOL

Category - ABAP

Type pools are obsolete, but the use continues. How best to deal with it in the future, you will find out here today.

08/23/2019