04-22-2007 6:37 PM
hi i want to know the difference between header line and work area
04-22-2007 8:03 PM
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
04-22-2007 6:41 PM
04-22-2007 7:40 PM
04-22-2007 8:03 PM
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
04-23-2007 4:22 AM
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.
04-23-2007 4:34 AM
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