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

internal table??

Former Member
0 Likes
578

Hello!

What's here a problem? My program says is smth. wrong. Thank you!!

CLASS int_table DEFINITION.

PUBLIC SECTION.

TYPES: BEGIN OF table1,

mfirst TYPE i,

msecond TYPE i,

END OF table1.

CLASS-DATA wa1 LIKE TABLE OF table1 WITH HEADER LINE.

CLASS-METHODS myinterne.

ENDCLASS.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
563

CLASS-DATA wa1 LIKE TABLE OF table1 WITH HEADER LINE.

internal tables with header lines are not allowed in Object Oriented ABAP!

6 REPLIES 6
Read only

Former Member
0 Likes
563

Hi,

CLASS int_table DEFINITION.

PUBLIC SECTION.

TYPES: BEGIN OF table1,

mfirst TYPE i,

msecond TYPE i,

END OF table1.

CLASS-DATA wa1 type TABLE of table1.

ENDCLASs.

regards,

Santosh Thorat.

Read only

JozsefSzikszai
Active Contributor
0 Likes
564

CLASS-DATA wa1 LIKE TABLE OF table1 WITH HEADER LINE.

internal tables with header lines are not allowed in Object Oriented ABAP!

Read only

0 Likes
563

Ok, but if I write the method:

METHOD myinterne.

wa1-mfirst = 2.

ENDMETHOD.

The program says "wa1 is a table without a header line and therefore has no component called mfirst". What's here wrong?

Thanks!

Read only

0 Likes
563

you have to define a work area (structure) as well, same as your internal table. assign values to the work area and APPEND it to the internal table.

Read only

0 Likes
563

example, pls? I've just define and still a problem.

Thanks!!

Read only

0 Likes
563

definition:

  • work area

CLASS-DATA wa1 type table1.

  • internal table

CLASS-DATA itab_wa1 type TABLE of table1.

  • assign data to work area

wa1-mfirst = 2.

  • append line to internal table

APPEND wa1 TO itab-wa1.