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: 

difference b/w headerline and workarea

Former Member
0 Kudos

hi i want to know the difference between header line and work area

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Sateesh

Technically there is no big difference between a header line and a work area (except for the different name).

However, if you prefer to write <b>error-prone</b> applications that are <b>difficult to maintain</b> then you should use old-fashioned itab's with header lines. If not then you will always use work areas.

Regards

Uwe

5 REPLIES 5

Former Member
0 Kudos

Work area is like a structure which contain one record at a time.

Header line is some what similar to work area in a way that it also contain one records but it stores the currently active record from the internal table.

Regards,

Rohit

Reward the helpful replies.

raja_thangamani
Active Contributor
0 Kudos

Look at this thread with example..

<i>* Reward each useful answer</i>

Raja T

uwe_schieferstein
Active Contributor
0 Kudos

Hello Sateesh

Technically there is no big difference between a header line and a work area (except for the different name).

However, if you prefer to write <b>error-prone</b> applications that are <b>difficult to maintain</b> then you should use old-fashioned itab's with header lines. If not then you will always use work areas.

Regards

Uwe

Former Member
0 Kudos

Hi sateesh,

<u><b>Difference between Work Area and Header Line</b></u>

<u><b>Header Line</b></u>

While adding or retrieving records to or 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.

The header line is a field string with the same structure as a row of the body, but it can only hold a single row.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

<u><b>Work Area</b></u>

Work area is of the same structure like internal table referred, it will also possess only one record, but this is declared explicitly, to perform calculations and other manipulations.

Work area is like a paper and pencil concept, where the calculations and manipulations will be done and will be erased after the execution.

e.g.

data: wa_itab like itab. " explicit work area for itab

data: itab1 like itab occurs 10. " table is without header line.

Former Member
0 Kudos

sateesh,

Difference between Work Area and Header Line

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.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

data: wa_itab like itab. " explicit work area for itab

data: itab1 like itab occurs 10. " table is without header line.

The header line is a field string with the same structure as a row of the body, but it can only hold a single row.

It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htmregards

Don't forget to reward if useful