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: 

internal tables

Former Member
0 Kudos

difference between implicit and exlicit work area, in performance point of view

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

5 REPLIES 5

FredericGirod
Active Contributor
0 Kudos

Have a look to the Tips & Tricks of SE30.

for performance and internal table works, the better is the field-symbols.

Former Member
0 Kudos

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

Former Member
0 Kudos

SAP recomends to use work areas than header.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.