Application Development and Automation 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: 
Read only

iTAB & wa

Former Member
0 Likes
1,004

Daer All,

I have one question that...as we can display data through itab only then why do we need to have WA. Cant we only work with itab.

Please clear with some solid example.

Thanks & Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
971

Hi ,

Instead of touching direct internal table it is good idea to pick up one record which you want and do the manipulation on that record and if you want modify it.

For this purpose only, this work area concept is there.

Thanks.

Daer All,

I have one question that...as we can display data through itab only then why do we need to have WA. Cant we only work with itab.

Please clear with some solid example.

Thanks & Regards.

7 REPLIES 7
Read only

former_member188827
Active Contributor
0 Likes
971

if u ve declared ur internal table with 'WITH HEADER LINE' addition u dont need a work ares. but if not den work area is required to hold date of internal table.

Read only

varma_narayana
Active Contributor
0 Likes
971

Hi Abhay...

Itab : stores multiple rows at a time.

Wa : Stores one row at a time.

So To process the ITab row by row we must read the Record into WA then Display the Workarea.

Eg:

LOOP AT ITAB INTO WA.

write: / wa-field1, wa-field2.

ENDLOOP.

We cannot directly display the data from ITab.

<b>Reward if Helpful</b>

Read only

Former Member
0 Likes
971

hi,

Whenever u r retrieving the data from Internal Table first it takes the record from the work area.Work area holds a single record at a time.Thats y instead of taking the records from the Internal Table we will take the records from the Work area.

Read only

former_member188827
Active Contributor
0 Likes
971

e.g.

data: itab type table of it with header line,itab1 type table of it.

data wa type it.

incase of itab u can directly append records in internal table as:

itab-field1 = 'A'.

append itab.

nut incase of itab1 u need a work area wa.

wa-field1= 'A'.

append wa to itab1.

same goes wen diplaying data .

for itab...

loop at itab.

write itab-field1.

endloop.

for itab1...

loop at itab1 into wa.

write wa-field1.

endloop.

plz reward points if it helps

Message was edited by:

abapuser

Read only

Former Member
0 Likes
971

Hi Abhay

U need a WA to do some manipulation on some records and if u want to update ur itab with those details

Cheers

~Arun

Read only

Former Member
0 Likes
971

Hi,

You can display data through internal table.

Internal table contains 2 parts. 1) Header and 2) Body. To process any internal table you have to work in either of the two ways.

1) Row by Row operation.

2) Array Operation.

For the row by row operation you need to have a work area defined of the same type of the internal table. This work area you can define at the time of defining the internal table as a header. Or you can define the same a structure.

Ex: loop at itab into wa.

// some code and logic

endloop.

For an array operation you do not need the header at all.

itab1[] = itab2[].

So you can figure out that we need the work area to get one row of information from the internal table at a time.

Thanks,

Samantak.

<b>Rewards points for useful answers.</b>

Read only

Former Member
0 Likes
972

Hi ,

Instead of touching direct internal table it is good idea to pick up one record which you want and do the manipulation on that record and if you want modify it.

For this purpose only, this work area concept is there.

Thanks.