Case Control Statement

The CASE control statement is used when we need to compare two or more fields.

No logical expressions can be used for the <field> field.

The field strings used in the CASE statement are treated as type C variable.

CASE VARIABLE.
WHEN VALUE1.
………
WHEN VALUE2.
…………

Strings are sequence of characters which used in ABAP programming largely. We use data type C variables for holding alphanumeric characters, with a minimum of 1 character and a maximum of 65,535 characters.

CONCATENATE

Combines two or more strings into one string.

Example :

REPORT Z_ABAP_DEVELOPER_TEST.

DATA: GV_S1 TYPE…

Logical Operators

Bellow table shows a list of logical operators for all data types.

Example

REPORT Z_ABAP_DEVELOPER_TEST.

DATA : GV_OP1 TYPE I VALUE 4,
GV_OP2 TYPE I VALUE 5,
GV_OP3 TYPE I VALUE 4,
GV_OP4 TYPE I VALUE 6.

IF GV_OP1 < GV_OP2.
WRITE:/ GV_OP1,’<’, GV_OP2.
ENDIF.

IF GV_OP2…

ABAP system variables is accessible from all ABAP programs.

These fields are filled by the SAP runtime environment and these variables are access by all the SAP system.

The complete list of ABAP system variables is found in the (SE11) SYST table in SAP.

Individual fields of the SYST structure can be accessed by using “SYST-“ or “SY-“.

The bellow table shows a sample program that uses system variables.

Example

REPORT Z_ABAP_DEVELOPER_TEST.

WRITE:/ ‘ABAP System Variables’.
WRITE:/ ‘Client : ‘ , SY-MANDT.
WRITE:/ ‘Date : ‘ , SY-DATUM.
WRITE:/ ‘Time : ‘ , SY-UZEIT.
WRITE:/ ‘Language :’, SY-LANGU.
WRITE:/ ‘Program : ‘, SY-CPROG.
WRITE:/ ‘Database:’ , SY-DBSYS.
WRITE:/ ‘Column No :’, SY-COLNO.
WRITE:/ ‘Index:’ , SY-INDEX.
WRITE:/ ‘Statu :’ , SY-SUBRC.
WRITE:/ ‘Transaction :’,SY-TCODE.

Output:

Variables are named data objects used to store values within the allotted memory area of a program. Variable can be used as a referring name of the data.

A variable must be declare before using it and each variable in ABAP should declare with specific data type and size.

Variable…

Constants

Constants are named objects used to store a values. CONSTANTS keyword used to declare constants. The value which is assigned to a constant can’t be changed during the execution of the program.

CONSTANTS: GC_PI TYPE P DECIMALS 2 VALUE ‘3.14’,
GC_YES TYPE C VALUE ‘X’.

Constant Name — Specifies…

Data Types

The Data Type field specifies the representation used internally by the database to store the value for that field.

Data type is used to describe the technical characteristics the data. For each data type, we need various variables to declare and process the data.

Some of the fields…

Basic Syntax

Each ABAP statement starts with an ABAP keyword and ends with a period. Keywords must be separated by at least one space.

The first line in the ABAP program begins with the word REPORT. As and when you execute the program you have to start with the first…

The ABAP Workbench is used by SAP for the development of standard and custom application software. The ABAP Workbench consists these tools to help you create development of the following components:

  • The ABAP/4 program editor where you can create and modify ABAP/4 source code and other program components, ıt’s used…

Feyza DERİNOĞLU

SAP Tutorials - Industrial Engineer & Software Developer & Management İnformation System and Engineering 👩🏻‍💻

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store