Skip to Content
avatar image
Former Member

data declaration

Hi

Can anyone explain the methods or techniques involved for data declaration in the latest ecc version.Am new to abap

Regards

Arun

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Sep 04, 2008 at 11:48 AM

    Go into editor. Type the word "DATA". Place cursor within the word "DATA". Press F1.

    Actually, before you even go near a SAP system, get a book about ABAP, or go on a training course, or at least read the help.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:50 AM

    Using Predefined Types

    1. DATA { {var[(len)] TYPE abap_type [DECIMALS dec]}

    | {var TYPE abap_type [LENGTH len] [DECIMALS dec]} }

    [VALUE val|{IS INITIAL}]

    [READ-ONLY].

    Reference to Existing Types

    2. DATA var { {TYPE [LINE OF] type}

    | {LIKE [LINE OF] dobj} }

    [VALUE val|{IS INITIAL}]

    [READ-ONLY].

    Reference Variables

    3. DATA ref { {TYPE REF TO type}

    | {LIKE REF TO dobj} }

    [VALUE IS INITIAL]

    [READ-ONLY].

    Structures

    4. DATA BEGIN OF struc [READ-ONLY].

    ...

    {DATA comp ...} | {INCLUDE {TYPE|STRUCTURE} ...}.

    ...

    DATA END OF struc.

    Internal Tables

    5. DATA itab { {TYPE tabkind OF [REF TO] type}

    | {LIKE tabkind OF dobj} }

    [WITH key] [INITIAL SIZE n]

    [WITH HEADER LINE]

    [VALUE IS INITIAL]

    [READ-ONLY].

    Ranges Table

    6. DATA rtab {TYPE RANGE OF type}|{LIKE RANGE OF dobj}

    [INITIAL SIZE n]

    [WITH HEADER LINE]

    [VALUE IS INITIAL]

    [READ-ONLY].

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:52 AM

    Hi,

    Follow the code below.

    ----


    • data definition

    ----


    types : begin of ty_ekko,

    ebeln type ekko-ebeln,

    lifnr type ekko-lifnr,

    bsart type ekko-bsart,

    aedat type ekko-aedat,

    ernam type ekko-ernam,

    end of ty_ekko.

    types : begin of ty_eket,

    ebeln type ekpo-ebeln,

    ebelp type ekpo-ebelp,

    werks type ekpo-werks,

    matnr type ekpo-matnr,

    menge type eket-menge,

    wamng type eket-wamng,

    netpr type ekpo-netpr,

    end of ty_eket.

    • Creating internal table using predefined structure type

    data : it_ekko type standard table of ty_ekko,

    it_eket type standard table of ty_eket.

    • Creating internal table using predefined structure type

    data : wa_ekko type standard table of ty_ekko,

    wa_eket type standard table of ty_eket.

    Hope this helps,

    Murthy

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 11:52 AM

    hi ,

    In the following way u can define

    1.

    *types :  begin of ty_itab,*
               *a type i,*
               *b type i,*
              *end of ty_itab.     "-------> this is  a  structure.....*
    
    *Data : wa_itab type ty_itab,  " -------> work Area ,*
              *it_itab type table of  ty_itab,  " -------> body*

    2.

    * Data  : begin of ty_itab occurs 0,**
               **a type i,**
               **b type i,**
              **end of ty_itab.     "-------> this is  a  structure with headerline/work area and body.**

    Regards.....,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:53 AM
    Add comment
    10|10000 characters needed characters exceeded