2006 Sep 22 7:38 AM
Hello everybody
do we have to declare an workarea if i declare a internal table..is OCCURS obsolete.can anyone please help.
Thanks and Regards
vijaya
2006 Sep 22 7:46 AM
hi vijaya,
to make more claer.
look this.
data : itab like ztable occurs 0 with header line.
here work area and itab is created.
data : begin of itab,
age like ztable-age,
endof itab.
only itab is created , no work area.
data : begin of itab <b>occurs 0</b>,
age like ztable-age,
endof itab.
here itab and work area is created.
rgds
anver
if useful mark points
Hello everybody
do we have to declare an workarea if i declare a internal table..is OCCURS obsolete.can anyone please help.
Thanks and Regards
vijaya
2006 Sep 22 7:41 AM
Hello,
It depend on ur requirement wether to declare work area or internal table completely.
Without occurs it is work area and vice-versa.
What is ur requirement actually?
Regards
2006 Sep 22 7:41 AM
Hi,
If u decalre internal table with header no need to declare work area.
internal table with header:
data: itab like mara occurs 0 with header line.
internal table with out header:
data: itab like mara occurs 0.
data: wa type itab. (Work area).
It is always advisable to use workarea.
Plz mark if useful
Regards
Divakar
2006 Sep 22 7:42 AM
HI,
if you are declaring with syntax, <b>data: begin of itab.</b>
or with header line then you don't need to declare.
otherwise you have to.
From 4.7 it is recmended to declare with header line. and use of workarea.
REgards,
2006 Sep 22 7:42 AM
Hi,
Yes , you have to declare work area if not using OCCURS while declaring internal table.
Best regards,
Prashant
2006 Sep 22 7:47 AM
types: begin of ty_itab,
field1,
field 2,
end of ty_itab.
data: itab type standared table of ty_itab.-->internal table without header line.
data: wa_itab like line of itab.--->work area
2006 Sep 22 7:46 AM
hi vijaya,
to make more claer.
look this.
data : itab like ztable occurs 0 with header line.
here work area and itab is created.
data : begin of itab,
age like ztable-age,
endof itab.
only itab is created , no work area.
data : begin of itab <b>occurs 0</b>,
age like ztable-age,
endof itab.
here itab and work area is created.
rgds
anver
if useful mark points
2006 Sep 22 7:53 AM
Hi!
Yes you are right! It is advisable to make a seperate Work area declaration as 'OCCURS' is Obsolete now.Typically as shown by Krishna Negi.
2006 Sep 22 7:58 AM
Hello,
OCCURS is not obsolete. But suggestion is that don't use that. Instead go for types and then declare your internal table as below,
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MATNR,
MTART TYPE MTART,
lv_xx TYPE c,
ENDOF TY_MARA.
DATA: lwa_mara type ty_mara, (Work Area)
lt_mara like standard table of lwa_mara.
(Int. tabel)
Regs,
Venkat Ramanan N
2006 Sep 22 9:22 AM
Thanks all...
is there is any specific reason to use workarea..
regards
vj
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |