Showing posts with label Type. Show all posts
Showing posts with label Type. Show all posts

Friday, April 26, 2013

0 Difference between TYPE and LIKE in ABAP


Difference between TYPE and LIKE in SAP ABAP :


TYPE : It will allocate memory during execution (object type).
       TYPE will improve performance.
       It is used when userdefined object link with SAP system data type.
       TYPE refers to the user defined data types
       TYPE,assign datatype directly to the data object while declaring.
     
LIKE :  Tt will allocate memory immediatly.
        It is when data object link with the other data object.
        LIKE refers to existing data type of data object
        LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.

Thursday, April 25, 2013

0 Variables in SAP ABAP

Variables in  SAP ABAP :



Variables are named data objects, you can declare variables statically using declarative statements, or dynamically while a program is running. They allow you to store changeable data under a particular name within the memory area of a program.


DATA is a keyword which is used to declare the variables in SAP ABAP

Syntax :
DATA < Variable Name> Type <Data Type>
                           (Or)
DATA <Variable Name> Like <Data Type>
Ex: DATA V1 Type I.
       DATA V2 Like I.

Type is abap keyword for reference
Fields :
         Elementary
        DATA vendor_code(10) TYPE C.
         Reference to Non Elementary
        TYPES vend_code(10)  TYPE C,
        DATA  vendor_code TYPE vend_code.
         Reference to existing fields
        DATA : vend_code(10) TYPE C,
                                   vendor_code LIKE Vend_code.



 

SAP-ABAP Copyright © 2011 - |- Template created by Vishnu - |- Powered by Blogger Templates