12-04-2007 12:20 PM
Hi all
can any body explain the difference between
DATA : t_caufv TYPE STANDARD TABLE OF caufv,
<b> wa_caufv LIKE LINE OF t_caufv.</b>
<b>( and ) </b>
DATA: it_aufk TYPE TABLE OF t_aufk,
<b> wa_aufk TYPE t_aufk.</b>
Message was edited by:
ABAPER1234
12-04-2007 12:25 PM
Functionally, no difference. It's a matter of taste and style. Sometimes you want to emphasise that the work area is used for a line of a table, so you'll use like, rather than the actual type. It saves you as a programmer, from having to look up the actual type, and it also provides a semantic (meaning) link between different data structures.
matt
12-04-2007 12:24 PM
Hi
<b>Like line of</b> is used to define a work area.
for ex : we have an internal table it_tab
data :it_tab type table of MARA initial size 0.
Now we define a work area for it_tab with name wa_tab
data : wa_tab like line of it_tab.
<b>TYPE-</b>you assign datatype directly to the data object while declaring.
12-04-2007 12:25 PM
DATA : t_caufv TYPE STANDARD TABLE OF caufv,
wa_caufv LIKE LINE OF t_caufv.
Ans: wa_caufv is the work area for internal table t_caufv, which will hold only one line of t_caufv at a time.
DATA: it_aufk TYPE TABLE OF t_aufk,
wa_aufk TYPE t_aufk.
Ans: this is also the same but you need to define the User defined type t_aufk.
Regards,
Satish
12-04-2007 12:25 PM
Functionally, no difference. It's a matter of taste and style. Sometimes you want to emphasise that the work area is used for a line of a table, so you'll use like, rather than the actual type. It saves you as a programmer, from having to look up the actual type, and it also provides a semantic (meaning) link between different data structures.
matt
12-04-2007 12:29 PM
HI
LINE OF can be used if type is a table type or if dobj is an internal table. If this addition is used, dtype inherits the properties of the line type of the internal table.
TYPE-you assign datatype directly to the data object while declaring
12-05-2007 10:55 AM
The first form has a slight advantage that if (for some reason) you change the type of the table, the workarea also changes.