Application Development 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: 

Question on Structure and Internal Table

Former Member
0 Kudos

Hi,

I have a basic ABAP question. When I check the value of I_MYPAYMENTS in the debugger, I see both a Structure and and array show up as shown here

http://image.prntscr.com/image/ef51f451bcd54b3194d26bbbd89d6ac5.png

When I click on the Structure, I can see that there are some values, but when I click on the Array I see zero records. For most other cases what I noticed was the values are generally the same. Can someone please explain, why 2 things are seen the variable with the same name. Also why would they have different values.

http://image.prntscr.com/image/c70a030f45ff4add8b7b14f05c584383.png

http://image.prntscr.com/image/238bdb7bf0594c64b4a6610b1896f985.png

5 REPLIES 5

Former Member
0 Kudos

The Structure is just a work area to hold data, in the case you illustrated the data has NOT been added to the table yet so that is why the table is empty.   If you have a table with multiple entries and you are reading it the structure will show you the current entry.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

This is the dreaded

Header line !!!

Therefore, the hat icon

matt
Active Contributor
0 Kudos

To explain further.

Header lines are, largely, obsolete. The reason is that itab can, in some contexts mean "the header line of itab", and in other contexts mean "the contents of table itab". This is ambiguous. And a basic principle of programming is that ambiguity is bad.

When you see itab[] in the debugger -that's the contents of itab.

When you see itab in the debugger that's the header line.

I think everything that could be said has been said, so I'm locking the thread here now.

Former Member
0 Kudos

If we define internal table with header line , then we don't require to create explicit work area.

If an in ternal table created with out work area we have create a work are of the similar structure of the table.

work area means a single line of table structure.

Example :-

Types : Begin of ty_itab,

              name(5) type c,

           End of ty_itab.

**without header line

Data : it_itab type table of ty_itab,

          wa_itab type ty_itab.

**With header line.

Data : it_itab like ty_itab occurs 0 with header line.

If you are working on latest SAP versions, then working with internal table using header line concept is obsolete. and Header line concept is not supported by Object oriented ABAP  .


Regards.

Neeraj.

former_member298154
Discoverer
0 Kudos

Hi,

You Define the Structure 'I_MYPAYMENTS' with Header Line .

thats why structure 'I_MYPAYMENTS[ ]' is coming like that