1 of 63

SAP S/4

ABAP Programming

for non-Technical Users

Create first ABAP Program

‘Hello World!’

Introduction to the ABAP Syntax

PARAMETERS and WRITE

2 of 63

  1. Create a Transport Request (TR) (SE10).
  2. Create a Package Z00 (SE80).
  3. Check the Package Z00 in the Transport Organizer (SE10).
  4. Create an ABAP Program ZABAP012 (SE80).
  5. Test the Program (SE10).
  6. Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  7. Test the Program in different Login Language (SE10).
  8. Check the Transport (SE10).
  9. Check the ABAP Program (SE38).

3 of 63

SE10 is the customizing request to create, change, display and released Transport Request for Customizing and Developments works in the SAP system

4 of 63

Workbench request

are for ABAP developers working with ABAP Workbench

Customizing request

are for Functional Consultants working with Configurations in the IMG

5 of 63

6 of 63

Double-click the Request/Task

  • Transport Requests (TRs) – is a kind of ‘Container / Collection’ of changes that are made in the development system. It also records the information regarding the type of change, the purpose of transport, request category and the target system. It is also known as Change Requests.
  • Each TR contains one or more change jobs, also known as change Tasks (minimum unit of transportable change). Tasks are stored inside a TR, just like multiple files are stored in some folder. TR can be released only once all the tasks inside a TR are completed, released or deleted.

7 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

8 of 63

9 of 63

In the drop-down list,

Select “Package”

An ABAP package is a transportable ABAP repository object that groups development objects of an ABAP system.

10 of 63

Enter either existing package number or a NEW one,

if it is new, it will go to Create mode

11 of 63

If Package entered is NEW, the dialogue will request if it is to be created

12 of 63

13 of 63

Assign the Package Z00 to the Transport Request T41K934197 created in the previous section

14 of 63

Package Z00 and ready for Development work like Developing ABAP Programs

15 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

16 of 63

Check the Package in the Transport Organizer

17 of 63

the EMPTY (although empty) is assign to the TR T41K934197

18 of 63

Double-click

19 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

20 of 63

In SE80, make use Select Package environment and Package ID “Z00”

Right-click the Package “Z00” and select

Create - Program

in the Dialgoue

21 of 63

A top include is nothing more that an include program which should hold all of your global declarations, such as variables, internal tables, and type statements. An include program is nothing more than a program which is designed to be included in another larger program, sort of like a modularization technique.

Program name must start with

Y or Z

22 of 63

Due to the Login Language, ALL ‘Text Symbol’ and ‘Selection Text’ will be in English

23 of 63

set Status “Test Program”

Executable Program

24 of 63

system defaults to the Package Z00 and as the Package is already assign to the TR T41K934197, the new Program will be Release to Client destination via this TR

25 of 63

26 of 63

Coding section

27 of 63

ABAP Syntax

PARAMETERS

PARAMETERS in an ABAP statements which are used to declare input ABAP variables in ABAP Programs or Report,

in this case z_name is the variable (but the variable name cannot be more than 8 characters).

This will allow the User to provide values for variables through the input screen.

28 of 63

syntax

PARAMETERS - TYPE

allow the variable to define as data types which can be String, Integer, etc or even TABLE-FIELD

eg:

PARAMETERS: z_matgrp TYPE MARA-MATKL,

z_age TYPE integer,

z_name TYPE string.

29 of 63

Syntax

WRITE: ‘text_string’.

Display the text_string as output

30 of 63

Syntax

NEW_LINE.

create a line break

31 of 63

Syntax

WRITE: ‘text_string’, z_name.

with a comma, the WRITE statement can continue to write/display even variable

32 of 63

‘text_string’(abc)

(abc) behind text string is a Text Symbol for the purpose of preparing Language Specific Text for different language Login display of the text_string

33 of 63

Double-click the new Text symbol to SAVE/Generate it

34 of 63

Pool of Text Symbols are be seen here

35 of 63

Double-click the new Text symbol to SAVE/Generate it

36 of 63

2 Text Symbols generated

37 of 63

Activate both Source Code, Text Symbols, and any other Objects

38 of 63

39 of 63

the Selection Text, in this case the variable name have not setup any different Display Text yet

40 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

41 of 63

Direct processing (Execute)

42 of 63

the variable z_name

have to setup a different text display

43 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

44 of 63

Enter a different text display for the variable z_name

45 of 63

These text are from the source code

46 of 63

Translation to “ZH” for Text Symbols and Selection Texts

47 of 63

Enter the text in the language “ZH” for Text Symbols and Selection Texts

48 of 63

49 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

50 of 63

current LOGIN is “EN” (English)

51 of 63

current LOGIN is “ZH” (Chinese)

52 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

53 of 63

check the new Program in the Transport Organizer

54 of 63

Double-click to view the Source Code

55 of 63

Double-click to view the Transport Request (TR)

56 of 63

The Objects can be Release here

57 of 63

Objects in the TR are Released

58 of 63

notice the little “green tick” after the TR objects are Released

59 of 63

  • Create a Transport Request (TR) (SE10).
  • Create a Package Z00 (SE80).
  • Check the Package Z00 in the Transport Organizer (SE10).
  • Create an ABAP Program ZABAP012 (SE80).
  • Test the Program (SE10).
  • Enter “Selection Text” text plus Language specific text for all Text Elements (SE10).
  • Test the Program in different Login Language (SE10).
  • Check the Transport (SE10).
  • Check the ABAP Program (SE38).

60 of 63

ABAP Programs can only be created/change/display using SE38

61 of 63

Tools in SE80 and SE38 for Program creation are similar

62 of 63

note the Package the Program was assigned automatically due to the method the Program was created in SE80

63 of 63