0 umn 2011 erp terapan abap introduction session # 8
TRANSCRIPT
1
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
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
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
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.
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.
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.
ABAP Workbench (SAP Development Tools)
John Natal 2011 / UMN8
• SE 80• SE 38• SE 11• SE 37• etc
Object Navigator
John Natal 2011 / UMN9
• SE80
Object Navigator
John Natal 2011 / UMN10
• SE80• NAVIGATION
• AREA
• REPOSITORY • OBJECTS
• DISPLAY AREA
Object Navigator
John Natal 2011 / UMN11
• SE80
Object Navigator
John Natal 2011 / UMN12
• SE80
• REPOSITORY• GROUPS
ABAP Editor
John Natal 2011 / UMN13
• SE38
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
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
General Syntax ABAP
John Natal 2011 / UMN16
General Syntax ABAP
John Natal 2011 / UMN17
General Syntax ABAP
John Natal 2011 / UMN18
John Natal 2011 / UMN19
Displaying Data: Sample ABAP/4 Code
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
21
Displaying Data: The WRITE Statement
The most basic ABAP/4 Command which outputs text/data to the screen.
22
Displaying Data: The WRITE Statement
New Line
without this, the output will be written on the current line
23
Displaying Data: The WRITE Statement
Column Position
without this, the output will be written on the current column
24
Displaying Data: The WRITE Statement
String Output Limiterthe output characters will be limited
to the assigned quantity
25
Displaying Data: The WRITE Statement
Outputcan be either a variable or constant
26
Displaying Data: Using the FORMAT Command
FORMAT [INTENSIFIED]
[INTENSIFIED OFF]
[COLOR color]
[COLOR OFF]
[INVERSE]
[INVERSE OFF]
[RESET].
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
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
29
Displaying Data: Displaying Messages
E Error The message appears and the application stops at the current point it is at.
30
Displaying Data: Displaying Messages
W Warning The message appears and the user must press enter for the application to continue.
31
Displaying Data: Displaying Messages
I Information A pop-up window opens with the message text, and the user must press Enter to continue.
32
Displaying Data: Displaying Messages
A Abend This message class cancels the transaction that the user is currently using.
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.
34
Displaying Data: Displaying Messages
X Abort This message aborts the program and generates an ABAP/4 Short Dump
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.
3636
The End
Praktikum ABAP
• SE 80
• SE 38• SE 11• SE 37• etc
John Natal 2011 / UMN37
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.
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
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’!!
41
SAP R/3 Basics: Creating an ABAP/4 Program
2. Make sure that the radio button is set at “Source Code”
42
SAP R/3 Basics: Creating an ABAP/4 Program
3. Click “Create”
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
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:
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
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
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”
48
SAP R/3 Basics: Creating an ABAP/4 Program
After Clicking “Save”, an Object Directory Window will appear:
49
SAP R/3 Basics: Creating an ABAP/4 Program
Type “&TMP” in the Development Class Field
And Click the “Save” Button
50
SAP R/3 Basics: Creating an ABAP/4 Program
OR
Just simply click the “Local Object” button
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.
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!