introduction to abap/4

46
Introduction to ABAP/4.

Upload: soyala

Post on 24-Jan-2016

57 views

Category:

Documents


1 download

DESCRIPTION

Introduction to ABAP/4. HISTORY OF SAP. SAP was founded in 1972 by five people: Wellenreuther, Hopp, Hector, Plattner and Tchira. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to ABAP/4

Introduction to ABAP/4.

Page 2: Introduction to ABAP/4

SAP was founded in 1972 by five people: Wellenreuther, Hopp, Hector, Plattner and Tchira.

Wellenreuther , while working at IBM , developed a financial accounting package running in batch for an IBM customer – Naturin. SAP bought rights from Naturin and started to design and implement the real-time finance system as a standard package based on Wellenreuther ’s experience in the application. They sold the first copy of the standard system to ICI.

Simultaneously, they developed a Materials management system as a bespoke software for ICI by reserving all property rights.

HISTORY OF SAP

Page 3: Introduction to ABAP/4

Strategic Thinking SAP may be part of a larger change project

Process Design Expertise in the design, change and documenting of business processes

Project Management Essential throughout the project lifecycle

Change Management Expertise is required in changing the organization

System Architect Overall responsibility for feasibility of the design and integration issues

Application Experts People with skills in configuring specific SAP modules

Business Analysts Involved in piloting and must be trained

Trainers Training must be given to the users and team members new to SAP

SAP Developers People who can design and build bolt-on functionality

Operations Staff Responsible for administration, performance and transition

Staffing of SAP Projects

Page 4: Introduction to ABAP/4

SAP Products and People

SAP Application Functionality

SAP Development Environment

AnalyzerSAP

ManualsConfiguration

MenuImplementation

Guide

BasisSystem Database Hardware

ConfigurationTeam

BusinessEnd Users

DevelopmentTeam

OperationsStaff

Page 5: Introduction to ABAP/4

STAGES OF SAP IMPLEMENTATION.

Scoping: 1 - 2 Months Decision making.Understanding the Organization.

Analysis 3 - 6 Months Documentation, Discussions

Design 2 - 3 Months Modules, Sub Modules, Interfaces, Databases, Dataflow.Servers, Terminals & Back up.

Development Parallel with Design.ABAP/4, Configuration,Applications, Transactions,Reports.

Configuration 3 - 4 days Settings to be done.( IT department of Customer is involved)

Implementation/Testing/Training

Post Implementation Support.

Page 6: Introduction to ABAP/4

Data Base Changes Batch Processing

Central DBCentral DB

User Interaction

Application Logic

(Stores all Data and Application Programs)

Reading DataBase and Updating Buffer

CentralDB buffer

CentralDB buffer

Output Data to User

Output Data to User

Input Data From User

Client Server Structure – Three Levels

Page 7: Introduction to ABAP/4

After SAP installed , Analysts experienced in Business Process Re-engineering (BPR) , who are also configuration experts, customize the modules to meet the Corporation's need, or help the corporation change it's business practices to achieve the most efficiency out of SAP.

This configuration does not usually involve programmers, but is instead done by Business Analysts. When the configuration process is nearing completion, the programmers ( Called ABAPers - specialists in ABAP/4) are brought in to extend any part of SAP that can not be configured to meet the needs of the corporation.

Where you fit in!

Page 8: Introduction to ABAP/4

OK. Lets’ get straight into ABAP/4

Page 9: Introduction to ABAP/4

ABAP/4

• Advanced Business Application Programming - 4 th generation Language.

• ABAP/4 is the backbone of SAP R/3.

• All the R/3 applications and parts of Basis system were developed in ABAP/4.

Page 10: Introduction to ABAP/4

ABAP/4 Dictionary

Transactions

ABAP/4 Editor

Menu Painter

Screen Painter

Translation menu

Object Browser

Function LibraryABAP/4

Page 11: Introduction to ABAP/4

When you login to a SAP serverthe following screen appears

Page 12: Introduction to ABAP/4

Enter the user name & password

Page 13: Introduction to ABAP/4

This is the screen you work !

Page 14: Introduction to ABAP/4

Select TOOLS ABAP/4 Workbench

for going into programming area.

Enter SE38 in the space and click on ‘tick’ icon on extreme left for EditorArea - Initial Screen.

Or Use the other Procedure like

This

Page 15: Introduction to ABAP/4

This is the famous workbench they talk about

ABAP/4 Development Workbench !

Click on ABAP/4 Editor buttonor enter the windowfor writing progrmas.

Page 16: Introduction to ABAP/4

You are in the Editor area

Page 17: Introduction to ABAP/4

Enter the Name of theProgram you want toStart.

Without giving a nameyou can not proceed.

The name shall start with Y or Z

Page 18: Introduction to ABAP/4

This screen prompts you to enter data

Page 19: Introduction to ABAP/4

ATTRIBUTESABAP/4

development

Attribute

ABAP/4 program attributes

Type .......................

Status .....................

Application ...........

Class ......................

Reporting

Test

System

Training

1

T

S

SCHU

F4 TypeReportModule pool, interactive programUpdate programInclude

F4 StatusTestProductive useCustomer programSystem program

1:M:V:I:

T:P:K:S:

Page 20: Introduction to ABAP/4

Enter the following:

Title for the report Type 1Application *

Page 21: Introduction to ABAP/4

Press F11 for saving

Page 22: Introduction to ABAP/4

Select Local Object and press the icon on the left side.

Page 23: Introduction to ABAP/4

You Come back to this screen

Press F3 to go back or use Back arrow.

Page 24: Introduction to ABAP/4

Click on Change

Page 25: Introduction to ABAP/4
Page 26: Introduction to ABAP/4

To insert more lines for writing program.

Place the cursor at theend of first line and pressF7 or click on 5th icon fromLeft on toolbar.

Page 27: Introduction to ABAP/4

Now you have completed your first program.

Press CTRL + F2 for checking whether the syntax is right. ( 2 nd Icon from left)

Press F11 or click on open book icon to save.

Press F8 to execute the program you just wrote.

Page 28: Introduction to ABAP/4
Page 29: Introduction to ABAP/4

Congrats!

You have just become an ABAPer.

Page 30: Introduction to ABAP/4

Lets’ take a bigger program

Take data from a table called

TABNA

and print the following fields

NAME1, STREET, CITY.

contents on the screen

Page 31: Introduction to ABAP/4

Sy-tvar0 to sy-tvar9 aresystem variables. You can assign any value. They are used in header in this program. Ignore them for now.

Page 32: Introduction to ABAP/4
Page 33: Introduction to ABAP/4

Screen Attributes

REPORT B170D034.

FORMAT INTENSIFIED OFF.WRITE : ‘*********************************’.SKIP 2.FORMAT INTENSIFIED.WRITE : /5 ‘Date’.WRITE: 20 SY-DATUM DD/MM/YYYY.FORMAT INTENSIFIED OFF.WRITE: /5 ‘Time’, (8) SY-UZEIT UNDER SY-DATUM.

1

**************************************************** Date 31/01/1992 Time 09:06:51

31.01.1992

Writes in BOLD Letters

Turns Off BOLDLetters

Page 34: Introduction to ABAP/4

COMMENTSFull line Comment.• A Star ( * ) is placed in the first position of the Line.

Partial line comment.• Double quote ( " ) is placed before you start a comment

Full Line Comment.

Partial Line Comment.

Page 35: Introduction to ABAP/4

Key Words

• Declaratives (DATA,.)• Events (GET,...)• Control (IF,...)• Operational (WRITE,)

Page 36: Introduction to ABAP/4

STATEMENTS*ABAP/4 Programs is built of Statements.* A Statement is a sequence of Words which always start with a ABAP/4 reserved keyword

like Report, Data, Write etc.* All statements ( except comments ) shall terminate with a period (.)* A word in a statement is delimited by blank spaces on both sides.* Statements can begin anywhere on a line* Multiple statements can be placed on a single line* Single statement may be stretched across multiple lines

Page 37: Introduction to ABAP/4

Colon Notation

OUT PUT ON SCREEN

For readability Colon ( : ) can be used.Note the ( : ) after WRITE, ( , ) after first two lines and ( . ) at the end of the statement.

Page 38: Introduction to ABAP/4

CHAIN STATEMENTS

WRITE ‘XYZ’.WRITE NAME.WRITE COUNTER.

WRITE : ‘XYZ’ , NAME, COUNTER.

ADD 1 TO COUNTER1.ADD 1 TO COUNTER2.ADD 1 TO COUNTER3.

ADD 1 TO : COUNTER1, COUNTER2, COUNTER3.

Page 39: Introduction to ABAP/4

* Variables must be declared in the program.

* Variables can be upto 30 characters.* Key words of ABAP/4 shall not be used as variables.

* The declaration process consists of telling the system what type of data will be stored in the temporary location associated with the

variable.

* These variables persist only during the execution of the program, and the data they contain is lost when execution is complete.

* Variables can be declared at any point in a program. However it is preferable to define at the begining of a program.

* Begin variable with a letter and then a combination of letters & numbers. Hyphen or Dash (-) is allowed. But do not use it.

VARIABLES

Page 40: Introduction to ABAP/4

Type Characteristic Example.

C Character “Any character”D Date "19980701"I Integer 500N Numeric text 00500T Time "223010"

others

F Floating point NUMBER 5e7p PACKED DECIMAL 200.50X Hexadecimal 23 A

DATA TYPES

Page 41: Introduction to ABAP/4

DATA TYPES AND THEIR ATTRIBUTES

Data Type Meaning Initial valueStandardlength

Allowed length

P

F

I

N

C

T

D

X

Packed Number

Integer

Floating point no.

Numeric text

Text

Date YYYYMMDD

Time HHMMSS

Hexadecimal

0 8 1-16

0 4 -

0.000 . . . 8 -

00 . . . 0 1 1-max

Space 1 1-max

00000000 8 8

000000 6 6

X ‘00’ 1 1-max

Page 42: Introduction to ABAP/4

Conditional Operators# CASE# IF# ON CHANGE OF

CASE: The case statement is used to indicate conditions for data that falls in a specific categories.

Syntax:CASE field.

WHEN value1.Command lines.

WHEN value1.Command lines.

WHEN OTHERS.Command lines.

ENDCASE.

Example:

DATA: w_year(4) .W_year = ‘1998’.CASE w_year. WHEN ‘1997’.

WRITE ‘The year is ‘1997’. WHEN ‘1998’.

WRITE ‘The year is ‘1998’. WHEN OTHERS.

WRITE ‘The year is unknown.ENDCASE.

Page 43: Introduction to ABAP/4

SELECT statement I

TableTABNA

Table description TABNASHOW TABNA

TABNA-COUNTRY CHAR C 3

TABNA-ID CHAR C 8

TABNA-NAME1 CHAR C 25

NAME Type Length

DDIC

Table work area TABNA

PROGRAM B170D061.TABLES: TABNA.SELECT * FROM TABNA.

WRITE: / TABNA-COUNTRY, TABNA-ID,TABNA-NAME1, . . . .

ENDSELECT.

Implied Loop

Page 44: Introduction to ABAP/4

SELECT statement II

REPORT B170D062.TABLES: TABNA.SELECT * FROM TABNA

WHERE COUNTRY = ‘USA’.

statements

ENDSELECT.IF SY-SUBRC NE 0.

statements

ENDIF.

Page 45: Introduction to ABAP/4

Internal Tables play major role in SAP.Understand the concept of Internal Tables well before

you do something!

SELECT * FROM <table>

INTO TABLE <internal table>

APPENDING <internal table>

WHERE . . .

ORDER BY . . .

REPORT B180D06B.TABLES: TABNA.DATA: BEGIN OF TAB OCCURS 200.

INCLUDE STRUCTURE TABNA.DATA: END OF TAB.* note the extra DATA: statement required for an INCLUDE.SELECT * FROM TABNA INTO TABLE TAB

WHERE COUNTRY = ‘USA’.LOOP AT TAB.

WRITE: /TAB-COUNTRY,TAB-ID,TAB-NAME1.

END LOOP.

Page 46: Introduction to ABAP/4

I have tried to give some info to take a look at ABAP/4. Go through training or refer books to master ABAP/4.

SAP is difficult to master.Concentrate on what you are good at.

ALL THE BEST !