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

ABAP Objects?

Former Member
0 Likes
465

Hello Friends,

Is ABAP Objects (Object Oriented) Supports Header Lines? If not, why Abap Objects doesn't Support?

Thanks & Regards

Sathish Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
442

Hi Sathish,

ABAP Objects does not support Header Lines.

Here's an excerpt stating the reason:

Tables with header lines not allowed

Only tables without header lines can be declared in ABAP Objects.

Error message in ABAP Objects if the following syntax is used:

DATA itab TYPE LIKE TABLE OF ... WITH HEADER LINE.

Correct syntax:

DATA: itab TYPE LIKE TABLE OF ... ,

wa LIKE LINE OF itab.

<b>Reason:

It depends on the statement whether the body or header line of a table is accessed. The table name should identify the table uniquely. Programs are easier to read. Tables with header lines do not improve performance.</b>

Note:

When calling external procedures (subroutines and function modules), which contain TABLES parameters in their parameter interface, please note that a TABLES parameter always requires a header line in addition to a table body. When a table without header line is transferred, the header line of the TABLES parameter retains its initial value. When calling such procedures in methods, you have to check whether transfer of the header line is expected in the procedure and evaluated there. You may have to adjust or rewrite the procedure. Method interfaces do not have TABLES parameters.

2 REPLIES 2
Read only

Former Member
0 Likes
443

Hi Sathish,

ABAP Objects does not support Header Lines.

Here's an excerpt stating the reason:

Tables with header lines not allowed

Only tables without header lines can be declared in ABAP Objects.

Error message in ABAP Objects if the following syntax is used:

DATA itab TYPE LIKE TABLE OF ... WITH HEADER LINE.

Correct syntax:

DATA: itab TYPE LIKE TABLE OF ... ,

wa LIKE LINE OF itab.

<b>Reason:

It depends on the statement whether the body or header line of a table is accessed. The table name should identify the table uniquely. Programs are easier to read. Tables with header lines do not improve performance.</b>

Note:

When calling external procedures (subroutines and function modules), which contain TABLES parameters in their parameter interface, please note that a TABLES parameter always requires a header line in addition to a table body. When a table without header line is transferred, the header line of the TABLES parameter retains its initial value. When calling such procedures in methods, you have to check whether transfer of the header line is expected in the procedure and evaluated there. You may have to adjust or rewrite the procedure. Method interfaces do not have TABLES parameters.

Read only

Former Member
0 Likes
442

Hi ,

Abap Objects doesn't support header lines you have create a table type for declaring a table or using standard table keyword .

You require wa to be declared separately .

Please reward if useful.