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
388

what is the diff between with header and without header ?

3 REPLIES 3
Read only

Former Member
Read only

Former Member
0 Likes
364

Hi,

a) Data : itab like mara occurs 0 with header line.

b) Data: itab like mara occurs 0.

-While adding or retrieving records to / from internal table we have to keep the record temporarily.

-The area where this record is kept is called as work area for the internal table.

-The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.

-Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.

Regards,

Ferry Lianto

Read only

former_member187255
Active Contributor
0 Likes
364

Balu,

WITH HEADER LINE creates a field with the same name as the internal table and the same type as the line type of the internal table.

Meaning it creates a work area of the line type of the internal table..

Example

-


DATA: ITAB LIKE MARA WITH HEADER LINE.

**Now you can use ITAB as a structure also..

**meaning.

ITAB-MATNR = 'ABCD'.

IF ITAB-MATNR = 'ABCD'.

      • True

ENDIF.

If you don't give header line..then the workarea is not created..

Example

-


DATA: ITAB LIKE MARA OCCURS 0.

DATA: WA LIKE ITAB.

To access the data you have to create another workarea ..

READ TABLE ITAB INTO WA INDEX 1.

IF WA-MATNR = 'ABCD'.

...

ENDIF.

Regards.