02-08-2008 6:07 AM
difference between implicit and exlicit work area, in performance point of view
02-08-2008 6:24 AM
Hi Soorya,
A work area mentioned explicitly in the append statement is known as an explicit work area. Any field string having the same structure as a row of the internal table can be used as an explicit work area. If a work area is not mentioned, the implicit work area (the header line) is used.
From performance point of view:
Avoid unnecessary assignments to the header line when using internal tables with a header line.
For example,
"APPEND wa TO itab."
is approximately twice as fast as
"itab = wa. APPEND itab.
The same applies to COLLECT and INSERT.
Whenever possible, use statements that have an explicit work area.
APPEND workarea TO itable.
INSERT workarea INTO itable.
COLLECT workarea INTO itable.
MODIFY itable FROM workarea.
READ TABLE itable INTO workarea.
LOOP AT itable INTO workarea.
Reward points, if useful.
Regards,
Nitin.
02-08-2008 6:08 AM
Have a look to the Tips & Tricks of SE30.
for performance and internal table works, the better is the field-symbols.
02-08-2008 6:10 AM
well if u create implicit work area then u cannot use it while dealing with other itab of same structures. so it is always preffered to have itab without headerline that is explicit work area.
reward if useful
vivek
02-08-2008 6:13 AM
02-08-2008 6:18 AM
Hi,
If we consider performance issue,better to declare the work area explicitly.
Follow the steps to define the internal table
1.Define the structure.
2.Define the internal table of Structure type.
3.Declare work area based on this structure.
Ex:-
TYPES: BEGIN OF T_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
AUDAT TYPE VBAK-AUDAT,
VBTYP TYPE VBAK-VBTYP,
NETWR TYPE VBAK-NETWR,
VKORG TYPE VBAK-VKORG,
VKGRP TYPE VBAK-VKGRP,
VBKLT TYPE VBAK-VBKLT,
LINE_COLOR(4) TYPE C,
END OF T_VBAK.
DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
WA_VBAK TYPE T_VBAK.
Reward points,if it is useful.
Thanks,
chandu.
02-08-2008 6:24 AM
Hi Soorya,
A work area mentioned explicitly in the append statement is known as an explicit work area. Any field string having the same structure as a row of the internal table can be used as an explicit work area. If a work area is not mentioned, the implicit work area (the header line) is used.
From performance point of view:
Avoid unnecessary assignments to the header line when using internal tables with a header line.
For example,
"APPEND wa TO itab."
is approximately twice as fast as
"itab = wa. APPEND itab.
The same applies to COLLECT and INSERT.
Whenever possible, use statements that have an explicit work area.
APPEND workarea TO itable.
INSERT workarea INTO itable.
COLLECT workarea INTO itable.
MODIFY itable FROM workarea.
READ TABLE itable INTO workarea.
LOOP AT itable INTO workarea.
Reward points, if useful.
Regards,
Nitin.