‎2008 Jan 31 4:51 AM
Why do v prefer the use of explicit work area rather than implicit work area?
‎2008 Jan 31 4:55 AM
‎2008 Jan 31 9:21 AM
hi
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.
u define internal table with header line then its an implicit work area.
Data: itab like mara occurs 0 with header line.
if u created work area then its an explicit work area
data : itab type standard table of mara,
wa_itab type mara.
Now Implicit work areas are outdated if u use that we will get the epc error. so we will explicit define the work area to avoid that.
for example.
data:
it_data type standard table spfli with header line. " implicit work area
Explicit work area.
data:
fs_data type spfli.
data:
it_data like table of fs_spfli.
*Difference in usage
implicit work area.
loop at it_data.
endloop.
explicit work area.
loop at it_data into fs_data.
endloop.
Please reward points if useful.
‎2008 Feb 01 10:31 PM
I don't think it has anything to do with performance, and I'd be surprised if there was a performance difference. It's about writing code that is more future-proof.
Explicit work areas are compatible with ABAP Objects and BADis. When I went on my first SAP training course back in 2003 some asked about tables with header lines. The instructor virtually put his fingers in his ears because he didn't want to teach it as going forwards SAP will phase it out.
‎2008 Feb 03 2:09 AM
Hi Mathews,
It does nt have anything to do with the performance. From ECC 6 ownwards many companies are prefrering the Explicit work area concept.
regards
Avi
‎2008 Feb 04 4:20 AM
HI
in the elucidation illustrated by me trough the example did not tell u about the memory.
let me tell u.
actually in the case of implicit workarea memory is wasted.but in the case of explicit work area memory is not wasted.it as runtime kind.
and other greatest advantage is the readability.with implicit workarea the names of those implicitly is confusing.
so in implicit workarea memory is unnecessarily wasted with no use of it actually
regards
sravani