1 of 28

SAP S/4

ABAP Programming

for non-Technical Users

Create first ABAP Program

‘Hello World!’

using SE38

introduction to ABAP Syntax

WRITE

2 of 28

  1. the First ABAP Program (SE38).
  2. Assign the ABAP Program to a t-code (SE93).

3 of 28

use SE38 to write the first ABAP Program

‘Hello World!’

Traditionally, Hello World programs are used to illustrate how the process of coding works, as well as to ensure that a language or system is operating correctly. They are usually the first programs that new coders learn, because even those with little or no experience can execute Hello World both easily and correctly.

4 of 28

In the Program field, enter ZABAP_001, then choose [Create].

in ABAP documentation, you are suppose to

use name for user-defined ABAPs which starts with Y or Z

and:

Program name starts with : Y-- is used for Local Development.

Program name starts with : Z-- is used for Actual Development.

(but

really does not matter as long as it starts with Y or Z as it is to differentiate with

other SAP delivered Standard ABAP programs which will use first character from A to X for the 1st letter of the Program names)

5 of 28

This specifies the type of program.

1 Executable Programs

Can be started without a transaction code,

either directly or in the background.

Executable programs are controlled by an invisible system program.

The system program calls processing blocks in the program in a pre-defined order. It displays the selection screen at the

beginning of the program and outputs a list at the end. Executable programs allow you to work with logical databases.

6 of 28

Status

The program Status specifies whether the program is a test program, a system program or a production program.

Depending on the Status, some of the utilities cannot be used. For example, you cannot use ABAP/4 debugging with System programs.

7 of 28

The language version Standard ABAP (Unicode) includes the entire ABAP language scope. The Unicode checks for programs in Unicode systems are applied.

8 of 28

9 of 28

The Editor begins with a template

.. this section is the comment section

Executable programs are introduced with the REPORT followed with the Program_name

and

Module pool programs are introduced with the PROGRAM statement.

10 of 28

Program syntax

WRITE ‘type text here’.

at the end of the code, press enter to append line.

green color shows hints of no error the syntax.

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: Test

Step 8: IF Change or Add ABAP coding (go back to Step 2)

11 of 28

Program syntax

WRITE ‘type text here’.

at the end of the code, press enter to append line.

green color shows hints of no error the syntax.

12 of 28

Program syntax

WRITE ‘type text here’.

at the end of the code, press enter to append line.

(with a missing ‘ before the . at the at the code line)

red color shows hints of some form of error the syntax.

13 of 28

Syntax check,

note below show error on Line 9 with some hints

14 of 28

Added the missing ‘

(note immediate green even before the syntax check)

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: TestStep 8: Change code (go back to Step 2)

15 of 28

NO more

syntax errors

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: Test

Step 8: IF Change or Add ABAP coding (go back to Step 2)

16 of 28

SAVE the Program

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: Test

Step 8: IF Change or Add ABAP coding (go back to Step 2)

17 of 28

ACTIVATE the Program

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: Test

Step 8: IF Change or Add ABAP coding (go back to Step 2)

18 of 28

click “Direct Processing”

Step 1: Write Syntax

Step 2: Syntax check

Step 3: Corrections

Step 4: Syntax check

Step 5: Save

Step 6: Activate

Step 7: Test

Step 8: IF Change or Add ABAP coding (go back to Step 2)

19 of 28

result of

Hello World

1st program

Title of the Program

20 of 28

  • the First ABAP Program (SE38).
  • Assign the ABAP Program to a t-code (SE93).

21 of 28

create a T-code

22 of 28

23 of 28

the Program name

SAVE

24 of 28

25 of 28

26 of 28

create a new

T-code

27 of 28

Execute the Program

28 of 28

1st ABAP Program