Skip to Content
author's profile photo Former Member
Former Member

what is the difference between like line of and type....

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Dec 04, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.