Friday, 15 September 2017

ABAP: Defining variables using colon notation

In my previous post, I explained how to define variables. By using colon notation, you can define multiple variable in one shot.

Example
DATA: first_name TYPE STRING,
      last_name TYPE STRING,
      age TYPE I.

Z_HELLO_WORLD
*&---------------------------------------------------------------------*
*& Report Z_HELLO_WORLD
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z_HELLO_WORLD.

* Defining Variables
DATA: first_name TYPE STRING,
      last_name TYPE STRING,
      age TYPE I.

first_name = 'Hari Krishna'.
last_name = 'Gurram'.
age = 28.

Write first_name.
Write / last_name.
Write / age.



Previous                                                 Next                                                 Home

No comments:

Post a Comment