MINS298c ABAP/4 Programming

Download Report

Transcript MINS298c ABAP/4 Programming

MINS298c
ABAP/4 Programming
Gail Corbitt
Fall 1998
Chapter 1-3
CSU
Chico
 SAP AG
Chapters 1-3
 Some Key Features
 Repository Concept

(development workbench)
 Beginning Program
CSU
Chico
 SAP AG
Key Features
 Advanced Business Application Program
 Multi language
 Interpretive Language
 Event Driven
 Reusability

Data Objects

Subroutines (which are called ??? in ABAP)
CSU
Chico
 SAP AG
Multi-Language
 Documentation
 Titles & Headers
 Text Symbols
 Selection Text
 Text Fields
 Message Texts
CSU
Chico
 SAP AG
Re-usability
 Patterns
 Subroutines
 Data Objects
 Structures
CSU
Chico
 SAP AG
Repository Concept
Developers
CSU
Chico
 SAP AG
Data Models
Dictionary Types
Table Structures
Programs
Screens
Functions
Patterns
More...
Users
Repository Concept
Developer
Group 1
Users
Developer
Group 2
CSU
Chico
 SAP AG
Program
 A Program has:

Source code

Text elements
 title
 selection text
 text symbols

Variants

Attribute

Documentation
CSU
Chico
 SAP AG
A Program
Text elements
Variants
Repository
Attributes
Source Code
Type
Status
Application
Title
Dev. Class
CSU
Chico
 SAP AG
Attributes (For now)
 Program Name Convention

ZZ##EX**

## is your assigned number

** is assignment number
 Program Type

1 (one) : Interactive
 Development Class

$TMP
 Local Object
CSU
Chico
 SAP AG
Editor for Source Code
 Two ways to get there

editor

Object Browser
 Three editor modes

command

pc

pc with line numbering
CSU
Chico
 SAP AG
Basic Language Constructs
 Reserved or Key words such as MOVE, WRITE, DATA
 Elementary Data Types:

Character -- C
Floating Point -- F

Integer -- I
Numeric Text -- N

Date -- D
Packed Decimal -- P

Time -- T
Hexadecimal -- X
 Construction Concept

Record - fixed number of related fields/data objects

Internal Table - variable number of related records
CSU
Chico
 SAP AG
Basic Language Constructs Cont
 Non-Elementary Data Types (User Defined)

Example: Types t_phone (20) type C.

Data customer_phone type t-phone.
 Data Object: (not defined explicitly) attributes and
entities
 References: uses key word LIKE copies attributes of
one data object into another
CSU
Chico
 SAP AG
Basic Syntax for Source Code
 Statements

not case sensitive

Keyword + series of space delimited words

ends with period

can span multiple lines

Literals are identified between single quotes
 Comments

* in first column of line

inline after double quote
CSU
Chico
 SAP AG
Basic Syntax for Source Code
 Colon notation

implies “repeat verb/ABAP reserved word”
 Example 1:
Write var-1. Write var-2. Write var-3.
Write: var-1, var-2, var-3.
 Example 2:
Write ‘The answer is: ‘. Write var-1.
Write: ‘The answer is: ‘, var-1.
CSU
Chico
 SAP AG
Some Verbs
 REPORT program name

REPORT ZZ99DB01
 DATA var(length) TYPE

Curr_date(20) TYPE C

Curr_date LIKE sy-datum
 Assignment

MOVE ‘XYZ’ to Curr_date.

Curr_date = ‘XYZ’.
 Write

WRITE / column position(length) dataname
CSU
Chico
 SAP AG
Basic Compile Environment
 Check = Syntax check
 Save = records current version of source code
 Generate = Compiles and generates object code
 Execute (does NOT save) = Runs or if does not exist
generates and runs
 Drill Down
 X Y Z editor buffers
 Help
CSU
Chico
 SAP AG
Assignment #1
 Create a program to display the following information
on the screen when executed

Current Date
Current Time

Client Number
Username

Language Key
System ID

R/3 Release
Database System

Operating System
>>> 1 item per line <<<
CSU
Chico
 SAP AG
Assignment #2
 Copy the program ZZ99DB01 (Debug 01) to your own
program name.

Edit and fix the compile error(s).

Include the PATTERN DEMO_PATTERN in the
program.

Change the title to include your name
CSU
Chico
 SAP AG