Video Lesson 4.2: Basic Abap Statements

Video Lesson 4.2: Basic Abap Statements

Defining Data Objects

  • Data objects are always defined with the DATA key word.
  • You can use an ABAP standard type, a local type, or a global type to type a data object.
  • You can refer to an already defined data object when defining additional variables (LIKE addition).
  • If the type information is missing in a variable definition, the standard type C is assumed.
  •  

    In contrast, if the length is missing, then the appropriate default length for the (incomplete) standard type is used.

 

 

  • The "DATA myvar." statement without type or length information thus defines a character variable with a length of 1 as the default length of type C is one.
  • Literals and constants belong to the fixed data objects.
  • You can use literals to specify fixed values in your programs.
  • There are numeric literals (specified without quotation marks) and text literals (specified with quotation marks).
  • You define constants using the CONSTANTS statement.

You can use the MOVE statement to transfer the contents of a data object to another data object.

The following two syntax variants have the same effect:

MOVE var1 TO var2.

var2 = var1.

  • If both data objects var1 and var2 are of different types, then there is a type conflict.
  • In this case, a type conversion is carried out automatically, if a conversion rule exists.
  • For detailed information on copying and the conversion rules, refer to the keyword documentation for the MOVE statement.
  • The CLEAR statement resets the contents of a data object to the type-specific initial value.



Share this on Social Media

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Unit 1 – SAP System Architecture

Unit 2 – Object Navigator, Repository and ABAP Programs

Unit 3 – Transparent tables in the ABAP Dictionary

Unit 4 – Basic ABAP statements, ABAP Structures and ABAP Logical Expressions

Unit 5 – ABAP Data Retrieval

Unit 6 – SAP Analysis Tools

Unit 7 – ABAP Subroutines

Unit 8 – ABAP Events

Unit 9 – ABAP User Interface

Unit 10 – Function Modules, Methods, ALV and BAPI

Unit 11 – Adjusting SAP Standard Software

Unit 12 – ABAP Debugger, Selection Screens, and Table Controls

Unit 13 – ABAP Web Dynpro

Unit 14 – Advanced Topics

Unit 15 – Advanced Topics II

Object Oriented (OO) ABAP

ABAP for SAP HANA (Introduction)

OData and SAP Netweaver Gateway