ABAP Source Code: Three approaches to define data objects
REPORT ZSOURCE0401.
* 1. Elementary types
DATA: CUSTOMER_NAME_1(25) TYPE C,
VENDOR_NAME_1(25) TYPE C.
* 2. Reference to an existing field
DATA: CUSTOMER_NAME_2(25) TYPE C,
VENDOR_NAME_2 LIKE CUSTOMER_NAME_2.
* 3. Reference to a non-elementary type
TYPES T_NAME(25) TYPE C.
DATA: CUSTOMER_NAME_3 TYPE T_NAME,
VENDOR_NAME_3 TYPE T_NAME.
———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info
If you like this post, you may as well like these too:
- ABAP Source Code: Types, data, constants REPORT ZSOURCE0402.* Type flag defines an abstract typeTYPES FLAG TYPE C. * Field address_flag will allocate space in main memory at runtimeDATA ADDRESS_FLAG TYPE FLAG VALUE ‘X’.* Constants are defined...
- How to define types and data objects REPORT CHAP0101. * Elementary type character, length 20DATA CUSTOMER_NAME(25) TYPE C. * Non-elementary typeTYPES T_NAME(25) TYPE C.DATA NEW_CUSTOMER_NAME TYPE T_NAME.* Reference to a data objectDATA VENDOR_NAME LIKE CUSTOMER_NAME. * RecordDATA:...
- ABAP Source Code: Character types REPORT ZSOURCE0403. * Type c is the default type when no type is specified.* Initial value is space, if it is not specified explicitly.DATA: NAME(25) TYPE C, CITY(25), FLAG, SINGLE_CHARACTER...
- ABAP Source Code: Syntax of ABAP/4 Programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 * Declaration...
- Source Code: Few simple examples 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30...
- Source Code: Designing a report REPORT ZSOURCE0104. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
- ABAP Programs: Complex Non-Elementary Types and Data Objects REPORT ZSOURCE0408. * Nested recordsTYPES: BEGIN OF ADDRESS, CITY(25), STREET(30), END OF ADDRESS, BEGIN OF PERSON, NAME(25), ADDRESS TYPE ADDRESS, END OF PERSON.DATA RECEIVER TYPE PERSON.RECEIVER-NAME = ‘Smith’.RECEIVER-ADDRESS-CITY = ‘Big...
- Source Code: Working with database tables and internal tables REPORT ZSOURCE0103. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
- ABAP Objects: Components of Class in ABAP Objects Components of Class in ABAP Objects DATA – for instance attributes METHODS – for instance methods EVENTS – for instance events Static components: CLASS-DATA – for static attributes CLASS-METHODS –...
- ABAP Objects – Class and objects Why do you need ABAP Objects? ABAP Objects oriented programming lets you to be at par with the others as this is better methodology. To understand the recent concept of...
- DEFINE : ABAP Keyword a day DEFINE Basic formDEFINE macro.EffectDefines a program component (macro) under the name macro . It must consist only of ABAP/4 statements and is expanded at compilation time.A macro should always be...
- Not Yet Using ABAP Objects? Eight Reasons why every ABAP Developer should give it a second look. SAP Introducted ABAP objects for a while ago now. Many ABAP Developers turned in and tapped the advantages...
- ABAP Programs: Copying structured objects * Using move-corresponding to copy fields with the same nameDATA: BEGIN OF MY_CUSTOMER, ID(8) TYPE N, NAME(25), CITY(25), END OF MY_CUSTOMER, BEGIN OF CITY_OF_CUSTOMER, CITY LIKE MY_CUSTOMER-CITY, TEXT(30), ID LIKE...
- ABAP Objects for JAVA Pro’s Contains : Similarities Between Java and ABAP ABAP Special Features Download from rapidshare or mediafire....
- ABAP Objects – Pros and Cons ABAP Objects establishes a different level of data encapsulation. In procedural programming the state of an application is held by global variables. In object-oriented programming, however, the state is kept...



















Leave a Reply