0 umn 2011 erp terapan abap introduction session # 8

52
1 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Upload: abel-hoover

Post on 26-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

1

UMN 2011

ERP Terapan

ABAP Introduction

Session # 8

Page 2: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Topik Bahasan

• ABAP Workbench• ABAP Dictionary• List Processing• Transaction Programming• Interfaces for data transfer

John Natal 2011 / UMN2

Page 3: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

3

What is ABAP/4?

ABAP/4 – “Advanced Business Applications Programming

Language 4th Generation”

• ABAP/4 was developed using C++

• SAP R/3 was made using ABAP/4

• ABAP/4 is the Development Tool of SAP R/3

Page 4: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

4

ABAP is a Tools

ABAP/4

• It is used by SAP developers to build the transactions that make up the R/3 application.

• It is also used by corporations to customize their R/3 applications.

• ABAP/4 is not used by customers of SAP to develop complex applications from scratch, but is used instead to provide additional business functionality

Page 5: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

5

The roles of ABAP/4 in SAP R/3

Two most common uses for ABAP/4:

1. Producing Custom ReportsA REPORT is an ABAP program that reads specific data from SAP’s database and then displays the data via a computer screen or a printed page.

2. Developing Custom Interfaces for SAPAn INTERFACE is an ABAP program that moves data into SAP, or reads data from SAP and writes it out to a system file to be transferred to an external computer system, such as a legacy mainframe.

Page 6: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

6

The roles of ABAP/4 in SAP R/3

Other uses for ABAP/4

1. Conversion Programs– Change data into a format usable by SAP

2. Custom Transactions– Similar to SAP standard transactions, but are

written to fulfill some business functions not provided by SAP standard transactions.

Page 7: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

7

The roles of ABAP/4 in SAP R/3

Final Notes:– From an ABAPer’s Perspective,

SAP is nothing more than a collection of database tables.

– The main concern of an ABAPer’s is how to present and modify these tables and their data as required by the user.

Page 8: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

ABAP Workbench (SAP Development Tools)

John Natal 2011 / UMN8

• SE 80• SE 38• SE 11• SE 37• etc

Page 9: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Object Navigator

John Natal 2011 / UMN9

• SE80

Page 10: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Object Navigator

John Natal 2011 / UMN10

• SE80• NAVIGATION

• AREA

• REPOSITORY • OBJECTS

• DISPLAY AREA

Page 11: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Object Navigator

John Natal 2011 / UMN11

• SE80

Page 12: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Object Navigator

John Natal 2011 / UMN12

• SE80

• REPOSITORY• GROUPS

Page 13: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

ABAP Editor

John Natal 2011 / UMN13

• SE38

Page 14: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Useful T-CODE for ABAP Developer’s

John Natal 2011 / UMN14

SE11 – ABAP/4 Dictionary Maintenance SE12 – ABAP/4 Dictionary Display SE16 – Data Browser SE24 – Class Builder SE37 – Function Builder SE38 – ABAP Editor SE41 – Menu Painter SE43 – Maintain Menu Area SE51 – Screen Painter SE71 – SAPScript Layout Set SE80 – Object Navigator / Development Workbench SE84 – ABAP/4 Repository Information System SE87 – Data Modeler Information System SE91 – Maintain Messages SE93 – Maintain Transaction

Page 15: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Useful T-CODE for ABAP Developer’s (Cont’d)

John Natal 2011 / UMN15

SM30 – Maintain Table View SM31 – Table Maintenance SM35 – View Batch Input Session SM37 – View Background Jobs SMOD - Editing/activating new customer enhancements CMOD - Editing/activating new customer enhancements SNRO - Object browser for number range maintenance SQ01 - ABAP/4 Query : Maintain Queries SQ02 - ABAP/4 Query : Maintain Funct. Areas SQ03 - ABAP/4 Query : Maintain User Groups ST22 - ABAP Dump analysis SU53 - Display Authorization Values for User SMARTFORMS – Create/Change SAP Smartforms ABAPDOCU – ABAP Documentation and Examples

Page 16: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

General Syntax ABAP

John Natal 2011 / UMN16

Page 17: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

General Syntax ABAP

John Natal 2011 / UMN17

Page 18: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

General Syntax ABAP

John Natal 2011 / UMN18

Page 19: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

John Natal 2011 / UMN19

Displaying Data: Sample ABAP/4 Code

Page 20: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

John Natal 2011 / UMN20

Displaying Data: Setting Up the Page

The first non-comment line in a Program. It names the Program and may affect the way in which output is formatted by the system

Page 21: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

21

Displaying Data: The WRITE Statement

The most basic ABAP/4 Command which outputs text/data to the screen.

Page 22: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

22

Displaying Data: The WRITE Statement

New Line

without this, the output will be written on the current line

Page 23: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

23

Displaying Data: The WRITE Statement

Column Position

without this, the output will be written on the current column

Page 24: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

24

Displaying Data: The WRITE Statement

String Output Limiterthe output characters will be limited

to the assigned quantity

Page 25: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

25

Displaying Data: The WRITE Statement

Outputcan be either a variable or constant

Page 26: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

26

Displaying Data: Using the FORMAT Command

FORMAT [INTENSIFIED]

[INTENSIFIED OFF]

[COLOR color]

[COLOR OFF]

[INVERSE]

[INVERSE OFF]

[RESET].

Page 27: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

27

Displaying Data: Displaying Messages

• Syntax

MESSAGE message type message number [WITH text].

• message type – a single character which defines the type of message displayed

• message number – a three-digit code referring to a corresponding text found in the message ID specified in the REPORT statement

• WITH text – additional text displayed together with the error message

Page 28: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

28

Displaying Data: Displaying Messages

Message Type Consequences

E Error The message appears and the application stops at the current point it is at.

W Warning The message appears and the user must press enter for the application to continue.

I Information A pop-up window opens with the message text, and the user must press Enter to continue.

A Abend This message class cancels the transaction that the user is currently using.

S Success This message provides an informational message at the bottom of the screen and does not impede the program in any way.

X Abort This message aborts the program and generates an ABAP/4 Short Dump

Page 29: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

29

Displaying Data: Displaying Messages

E Error The message appears and the application stops at the current point it is at.

Page 30: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

30

Displaying Data: Displaying Messages

W Warning The message appears and the user must press enter for the application to continue.

Page 31: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

31

Displaying Data: Displaying Messages

I Information A pop-up window opens with the message text, and the user must press Enter to continue.

Page 32: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

32

Displaying Data: Displaying Messages

A Abend This message class cancels the transaction that the user is currently using.

Page 33: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

33

Displaying Data: Displaying Messages

S Success This message provides an informational message at the bottom of the screen and does not impede the program in any way.

Page 34: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

34

Displaying Data: Displaying Messages

X Abort This message aborts the program and generates an ABAP/4 Short Dump

Page 35: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

35

Displaying Data: Displaying Messages

Important Note

• To output Messages, add the option “MESSAGE ID name” to the REPORT command.

• The message id name contains the standard texts for the error messages.

• To create a Message ID, just write the desired name (which has to start with either Z or Y) after the message-id option, then double-click the name.

Page 36: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

3636

The End

Page 37: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

Praktikum ABAP

• SE 80

• SE 38• SE 11• SE 37• etc

John Natal 2011 / UMN37

Page 38: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

38

SAP R/3 Basics: Creating an ABAP/4 Program

2 ways to access the ABAP Editor:

1. Type “SE38” in the Command Field,then press “ENTER”

2. Double Click, the Transaction Code Link “SE38” in the Favorites Box in the Easy Access Menu

* Applicable only if the Favorites Menu is already set-up.

Page 39: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

39

SAP R/3 Basics: Creating an ABAP/4 Program

The Usual Path in the SAP Standard Menu:

TOOLS > ABAP WORKBENCH > DEVELOPMENT > SE38 – ABAP EDITOR

Page 40: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

40

SAP R/3 Basics: Creating an ABAP/4 Program

Upon entering the ABAP Editor: Initial Screen…

1. Type your program name in the Program Name Field

All program names have to start with either a ‘Z’ or a ‘Y’!!

Page 41: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

41

SAP R/3 Basics: Creating an ABAP/4 Program

2. Make sure that the radio button is set at “Source Code”

Page 42: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

42

SAP R/3 Basics: Creating an ABAP/4 Program

3. Click “Create”

Page 43: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

43

SAP R/3 Basics: Creating an ABAP/4 Program

Display is used for viewing a program’s subobject without editing it

Change is used for editing a program’s subobject

Page 44: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

44

SAP R/3 Basics: Creating an ABAP/4 Program

Change is used If you want to edit a program

After Clicking “Create”, the Attributes Window will appear:

Page 45: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

45

SAP R/3 Basics: Creating an ABAP/4 Program

Change is used If you want to edit a program

1. Type The Program Title,which is usually the Program description

Page 46: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

46

SAP R/3 Basics: Creating an ABAP/4 Program

Change is used If you want to edit a program

2. Select “EXECUTABLE PROGRAM” under Type

Page 47: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

47

SAP R/3 Basics: Creating an ABAP/4 Program

Change is used If you want to edit a program

3. Click “SAVE” or press “ENTER”

Page 48: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

48

SAP R/3 Basics: Creating an ABAP/4 Program

After Clicking “Save”, an Object Directory Window will appear:

Page 49: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

49

SAP R/3 Basics: Creating an ABAP/4 Program

Type “&TMP” in the Development Class Field

And Click the “Save” Button

Page 50: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

50

SAP R/3 Basics: Creating an ABAP/4 Program

OR

Just simply click the “Local Object” button

Page 51: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

51

SAP R/3 Basics: Creating an ABAP/4 Program

Important Note!

• The Programs that you’ll be making are saved as Local Objects simply because they will never be transported from your Development Server to your Production Server.

• In actual practice, a Workbench Change Request Number is issued by the system for the Basis Consultants to properly transport your code.

Page 52: 0 UMN 2011 ERP Terapan ABAP Introduction Session # 8

52

SAP R/3 Basics: Creating an ABAP/4 Program

After Clicking “Save”or “Local Object”, You are now in the ABAP Editor

You can now start ABAPING!