04-19-2007 2:12 PM
Hi All,
Can any one give me a simple program for how this work area was used. and also let me know if by using this work area the performance of the program will increase or not.
Thanks in advance.
Regards
Ramana Prasad.T
04-19-2007 2:31 PM
Hi
Have a look at this sample code.
data it_lfa1 like lfa1 occurs 0.
data wa like lfa1.
select * from lfa1 into wa.
append wa to it_lfa1.
endselect.
loop at it_lfa1 into wa.
write:/ wa-lifnr,wa-name1,wa-land1.
endloop.
Regards
Haritha.
04-19-2007 2:14 PM
04-19-2007 2:15 PM
Hi Ramana,
check this link
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm
04-19-2007 2:16 PM
Hi,
tables :kna1
select single * from Kna1 where kunnr = '1000'.
write: / kna1-kunne, kna1-name1.
here when I declare the table KNA1 as TABLES by default work area of KNA1 is created which will hold a single record of KNA1.
We should not use table work areas, better to use internal tables for that to increase the performance.
reward if useful
regards,
Anji
Message was edited by:
Anji Reddy Vangala
04-19-2007 2:18 PM
Hi,
data:itab like mara occurs 0.
data:wa like mara.
select * from mara into table itab.
loop at itab into wa.
write:/ itab-matnr.
endloop.
for more info check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm
wa we'll use for moving the data into or getting the data from internal tables with out header lines.
with the use of this wa's performance will increases comared to using data:itab like mara occurs 0 with header line.
rgds,
bharat.
04-19-2007 2:21 PM
Work area used to retrieve or pass the records to the internal table, if the table without header line u have to use Work Area.
04-19-2007 2:31 PM
Hi
Have a look at this sample code.
data it_lfa1 like lfa1 occurs 0.
data wa like lfa1.
select * from lfa1 into wa.
append wa to it_lfa1.
endselect.
loop at it_lfa1 into wa.
write:/ wa-lifnr,wa-name1,wa-land1.
endloop.
Regards
Haritha.