Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the best-practice to replace that TABLES statement in OOABAP?

In the following code:

TABLES: lqua.
CLASS TEST DEFINITION.
PRIVATE SECTION.
  TYPES: BEGIN OF tt_data,
          lgpla TYPE lqua-lgpla,
          matnr TYPE lqua-matnr,
         END OF tt_data.
ENDCLASS.

How could I get rid of the TABLES statement? As far as I understand, it is best-practice to avoid the TABLES statement, and it is forbidden in classes. When I omit it, the definition of tt_data throws a syntax error because lqua-lgpla is unknown.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This does compile without any error.

REPORT zzpj_so.

CLASS test DEFINITION.
  PRIVATE SECTION.
    TYPES: BEGIN OF tt_data,
             lgpla TYPE lqua-lgpla,
             matnr TYPE lqua-matnr,
           END OF tt_data.
ENDCLASS.

What does not is for example this piece of code.

REPORT zzpj_so.

CLASS test DEFINITION.
  PRIVATE SECTION.
    TYPES: BEGIN OF tt_data,
             lgpla LIKE lqua-lgpla,
             matnr LIKE lqua-matnr,
           END OF tt_data.
ENDCLASS.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading