SAP StackFICOHRMMSDPMPSABAPNetWeaverTablesTcodes ☰MENU

Data statement and data types in ABAP

Data statement is used for defining variables in our ABAP programming.

The syntax of data statement:

After watching different data types used in ABAP we can see the usage of data statement with some examples.

Character data types used in ABAP

Numeric data types used in ABAP

Sample data statement declarations

Data x .

(Here variable x will be treated as character, because character is the default data type)

data x(2) type c .

(Here variable x will be treated as character with length 2)

data x type i value 100 .

(Here variable x will be treated as integer with default value 100)

data x type d value 20110112 .

(Here variable x will be treated as date with the specified default value)

 

By using like addition with data statement all the properties like data type , length of the previously defined variable will be assigned to the new variable. You will get a clear picture after seeing the following example.

 

Data x1(2) type c.

Data x2 like x1 .

(In this example variable x2 will get all the properties of variable x1. Means it will be treated as a character with length two)

 

In our ABAP program we need to use this statement several times and it’s a basic thing also.

Also Read : ABAP Tutorial Home page -> Steps to create ABAP program -> ABAP Transaction codes

SAP ALECRMSCMSRMSAP Solutions SAP ReferencesSAP BasicsPP ModuleWMSAP Partners
HomeContact & Privacy PolicyTwitter
All of the product names here are trademarks of their respective companies. The site sapstack.com is not affiliated with SAP AG.
©2024 sapstack.com