abap day 1.1 - overview

62
ABAP/4 Introduction & First Program

Upload: sachin-patil

Post on 12-Jul-2016

19 views

Category:

Documents


3 download

DESCRIPTION

SAP ABAP

TRANSCRIPT

Page 1: ABAP Day 1.1 - Overview

ABAP/4

Introduction & First Program

Page 2: ABAP Day 1.1 - Overview

Introduction to SAPS: SystemsA: ApplicationP: Products in Data Processing

Page 3: ABAP Day 1.1 - Overview

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 4: ABAP Day 1.1 - Overview

SAP Products and People

SAP Application Functionality

SAP Development Environment

AnalyzerSAP

ManualsConfiguration

MenuImplementation

Guide

BasisSystem Database Hardware

ConfigurationTeam

BusinessEnd Users

DevelopmentTeam

OperationsStaff

Page 5: ABAP Day 1.1 - Overview

Which Customer Requirements are met by the R/3 System?

Page 6: ABAP Day 1.1 - Overview

• SAP sets new standards for the universal use of standard software with its R/3 system. The R/3 System allows the complete integration of business and data processing based on Progressive development techniques.

•The components of the R/3 system are characterized by its comprehensive business functionality coupled with the latest technology. The integration of the applications guarantees transparency of all functions in the system and thus in the entire enterprise.

•The R/3 system is based on a complete business model covering the following application areas: Financial accounting, controlling, assets management, material management, production planning and control, sales logistics, quality management, plant maintenance, project management, service management, human resource management, office communication, workflow functions, industry solutions, open information warehouse.

SAP Overview

Page 7: ABAP Day 1.1 - Overview

STAGES OF SAP IMPLEMENTATION.

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

Analysis 3 - 6 Months Documentation, DiscussionsDesign 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 8: ABAP Day 1.1 - Overview

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 9: ABAP Day 1.1 - Overview

 

MM SD FI PP

ABAP/4 

OPERATING SYSTEM

BASIS

Schematic positioning of various components

Page 10: ABAP Day 1.1 - Overview

Client / Server Principles

• According to SAP terminology, a service is one that is offered by a software component (software-Oriented view). Such a component can consist of a process (see message server process) or a group Of processes, which is then called server for the corresponding service.

• Software components, that utilize the service, are called clients. Such clients can also be servers for Certain services

• Often it can be a computer that is understood as server, one on which software components run that Offer certain services (hardware- oriented view).

• The SAP system is understood as the totality of all software components that are allocated to the same database.

Page 11: ABAP Day 1.1 - Overview

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 12: ABAP Day 1.1 - Overview

Database

Application

Presentation

Central DB (stores all data andApplications programs)

Access to DB:Read /writedata

Input / OutputOf data to users

The Architecture Hierarchy

Page 13: ABAP Day 1.1 - Overview

Presentation Layer

• The presentation layer is the portion of SAP R/3 with which users interact directly.– Displays information to users– Transfer data entered by users to the application server layer

• Consists of the SAP R/3 Graphical User Interface Program (SAP-GUI)– Supported by PC, Mac or workstations– Provides the user with the screens ( ie. Menus, toolbars, and

function keys) required to process SAP R/3 transactions– Provides that same “Look and feel” to all users, regardless of the

platform.

Page 14: ABAP Day 1.1 - Overview

Application Layer

• Application servers that run programs– Programs manipulate data provided by the user and the database

• Associated servers that support applications– Run background programs, make database changes, format data

for printing, route messages between servers, manages locking for SAP objects, etc

• Server Distribution– Processing workload spread among multiple servers (load

balancing)– Some shared, central directories are required, such as start-up and

system profiles and the central system log

Page 15: ABAP Day 1.1 - Overview

Database Layer • The relational database system used by all application servers• Stores the SAP application programs and data• A SAP technology that “overlays” the database vendor’s database

management functions• Current SAP architecture is oriented towards a central database

server

Page 16: ABAP Day 1.1 - Overview

ABAP/4 Dictionary

TransactionsSE93

ABAP/4 EditorSE38

Menu PainterSE 41

Screen Painter SE 51

Layout developmentSE71

Object BrowserSE80

Function LibrarySE37

ABAP/4

ABAP tools - Overview

Page 17: ABAP Day 1.1 - Overview

Lets’ get straight into ABAP/4

Page 18: ABAP Day 1.1 - Overview

SAP AG

A dvanceddvanced B usinessusiness

P rogrammingrogrammingA pplicationpplication

/4

The ABAP/4 Programming Language

Overview of ABAP

Page 19: ABAP Day 1.1 - Overview

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 20: ABAP Day 1.1 - Overview

SAP AG

ABAP/4 Development Workbench Architecture

RuntimeRuntimeRuntime

DevelopmentDevelopmentDevelopment

Overview of ABAP

Page 21: ABAP Day 1.1 - Overview

The ABAP/4 Development Workbench provides access to Sap's development tools which cover the entire software development cycle. These tools can be used both for customer-specific developments and enhancements to R/3 applications supplied by SAP. All applications created with the ABAP/4 Development Workbench can run without further modifications on any platforms, database systems and graphical user interfaces supported by SAP.

Overview of ABAP

Page 22: ABAP Day 1.1 - Overview

• ABAP Development Work Bench consists of many tools for like ABAP Editor, Screen Painter, Function Builder, Menu painter… for you to create or write Programs like Reports or Screens or Menus etc ...

•Typically as a ABAP Developer you will be working on the above said Tools to design, develop and test any programs which include Reports, Screens, Menu that you might want to implement in SAP.

• During the Period of the Course you will be guided and taken through the tools one by one.

Overview of ABAP

Page 23: ABAP Day 1.1 - Overview

ABAP/4 Program Objects.

SAP AG

Global data

PBO modules

PAI modules

Subroutines

Screens

GUI status

Includes

Transactions

Development class

ProgramDev. class object types

Dictionary objects

Programs

Function groups

Includes

Transactions

Logical databases

Message classes

...

ABAP/4 Program Objects

Overview of ABAP

Page 24: ABAP Day 1.1 - Overview

•Development Class

• To create a program, you first specify a development class. Development classes are containers for objects in the same area. A common transport route is defined for all objects within a development class. Customer-specific development classes begin with Y or Z.

• If you are creating a test object which you do not want to be transported, choose local private objects. The development class is then set to $TMP.

• You then specify the name of the new program. To proceed, click the radio button Program and choose Display.

Overview of ABAP

Page 25: ABAP Day 1.1 - Overview

Overview of ABAP

•Development Class

• If you are creating a object which needs to be transported to production System from Development System, then choose the appropriate development class and then Click Save, then the system will ask for the “request No” under which your program needs to stored. At this point you can either specify the transport request number provided by system administrators or create your own request.

Page 26: ABAP Day 1.1 - Overview

Overview of ABAP/ Transport Organizer

Page 27: ABAP Day 1.1 - Overview

Overview of ABAP/ Transport Organizer

•Workbench requests record changes made to ABAP Workbench objects.

• There are local and transportable Workbench requests. (Local Workbench requests have the target system <space>.)

• The development class of the object and the transport route settings in the Transport Management System determine whether changes are recorded in a local or a transportable Workbench request.

Page 28: ABAP Day 1.1 - Overview

Transaction se09

Overview of ABAP/ Transport Organizer

Page 29: ABAP Day 1.1 - Overview

• ABAP/4 Interfaces

SAP AG

R

ABAP/4 Interfaces

Data transfer programData transfer programGeneration programGeneration program

Communicationsinterfaces

Communicationsinterfaces

sequential dataset

Data interfacesData interfaces

Non-SAP systemSAP R/2SAP R/3 SAP R/3

Overview of ABAP

Page 30: ABAP Day 1.1 - Overview

• ABAP/4 Interfaces Uses:

• When you use ABAP/4 Data interfaces, a sequential dataset is generated in the source system . This is read into the target system by the data transfer program and imported automatically into the R/3 database using batch input, call transaction or direct input.

• ABAP/4 contains statements for the implementation of Communication interfaces like RFC/BAPI, OLE which typically connects R/3 with Non R/3 system for establishing a transaction over the Net.

Overview of ABAP

Page 31: ABAP Day 1.1 - Overview

• As a ABAP Developer

• Majority of the work during and after implementation of R/3 will be Report programming, Dialog programming, BDC, Enhancements using ABAP/4 Programming Language.

•In reporting you use the ABAP/4 Open SQL to read data from the R/3 database. A report consists of a selection screen, on which you define the dataset you wish to display, and a list, which displays the data itself. In interactive reporting, the user can navigate from the (basic) list to details lists at runtime. Typically, reports merely read data from the database. However, it is also possible to make changes in the database using a report.

Overview of ABAP

Page 32: ABAP Day 1.1 - Overview

•Dialog Programming• In dialog programming you use the Screen Painter to create screens and program the sequence in which they appear. You write an ABAP/4 program (ABAP/4 module pool) for your screens. This is a collection of dialog modules which are called by the flow logic of your screens. You use dialog programs for both reading and changing database tables.

SAP AG

R

Reporting and Dialog ProgrammingDialog program (SAP transaction)

SelectionSelectionscreenscreen

Report

ListListscreenscreen

ScreenScreen01000100

ScreenScreen02000200

ABAP/4 Open SQLABAP/4 Open SQL

Overview of ABAP

Page 33: ABAP Day 1.1 - Overview

• Batch Data Communication (BDC)

•Batch Data Communication (BDC) offers transferring of data into the SAP System from other SAP Systems and non-SAP Systems (legacy systems).

•For example, the data collection in some areas of your company is still performed by a non-SAP system like VB-SQL or Java-Oracle etc. You can still consolidate all of your data in the SAP System by exporting the data from the other system and reading it into the SAP System with batch input.

Overview of ABAP

Page 34: ABAP Day 1.1 - Overview

• SAP Scripts

•SAP script is the tightly integrated text management system of the SAP R/3 System.

•It will therefore be used for many different text-processing tasks all over the SAP System.•Example:

•SAP script is used for incorporating the company logo in forms sets.• SAP Script can be used for printing the Sales order or the purchase order in the company given pre printed format.

Overview of ABAP

Page 35: ABAP Day 1.1 - Overview

• Enhancements

• SAP offers a broad range of functionality within its business application suite.

•If standard applications do not offer some of the functionality you need, You don’t have to Panic!!You don’t have to Panic!!

•R/3 provides the flexibility to Add-on/Bolt-on any application to its standard functionality This facility is called “Enhancement” and called as “User Exits”, “Menu Exits”, “Screen Exits” and “Function Exits”.

• Enhancement offers better alternative to the problem-ridden modification approach..

Overview of ABAP

Page 36: ABAP Day 1.1 - Overview

Before going to Next topic, Lets browse some important transactions in ABAP Development Workbench like

•ABAP Editor(se38) : used for Writing Report programs..etc

•Object Navigator(se80) : used for Creating Screens and/or Transactions or Development Class or navigation purpose ..etc

•Function Builder(se37): used for Writing Functions which can be further used in Report programs or Screen programming.. etc.

• Data Dictionary(se11) : Used for Database Table handling.. etc.

Overview of ABAP

Page 37: ABAP Day 1.1 - Overview

Overview of ABAP/ Basic Syntax of ABAP

SAP AG

ABAP/4 program

statement

word 1word 1word 1 word 2word 2word 2 word 3word 3word 3

word 4word 4word 4 .

key word parameter, field, constant

DATA COUNTER TYPE I.DATA NAME(20).

MOVE 1 TO COUNTER.MOVE 'ABC' TO NAME.

.

.

.WRITE NAME.WRITE COUNTER.

ABAP/4 Syntax

Page 38: ABAP Day 1.1 - Overview

Overview of ABAP/ Basic Syntax of ABAP

• ABAP/4 Syntax

•An ABAP/4 program consists of individual statements. Each statement must end with a period.

•The first word of a statement is known as the key word.

• Words are separated from each other by at least one blank.

•Statements can be indented.

•Statements can extend over several lines.

Page 39: ABAP Day 1.1 - Overview

• ABAP/4 Syntax/ Chain Statements.

Overview of ABAP/ Basic Syntax of ABAP

SAP AG

WRITE 'XYZ'.WRITE NAME.WRITE COUNTER.

WRITE 'XYZ'.WRITE NAME.WRITE COUNTER.

WRITE 'XYZ'.WRITE NAME.WRITE COUNTER.

WRITE: 'XYZ', NAME, COUNTER.

WRITE: 'XYZ', NAME, COUNTER.

WRITE: 'XYZ', NAME, COUNTER.

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

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

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

ADD 1 TO: COUNTER1, COUNTER2, COUNTER3.

ADD 1 TO: COUNTER1, COUNTER2, COUNTER3.

ADD 1 TO: COUNTER1, COUNTER2, COUNTER3.

Chain Statements

Page 40: ABAP Day 1.1 - Overview

• You can concatenate several consecutive statements with an identical first part into a chain statement.

• When doing this, conclude the identical first part with a colon. After the colon, separate each concatenated part from the next with a comma.

• Blanks can appear before and after the separators (colon, comma or period).

Overview of ABAP/ Basic Syntax of ABAP

• Commenting a ABAP Statement•You can insert comments into a program in two ways:

- An asterisk (*) in column 1 flags the whole line as a comment.

- A quotation mark (") within a line flags the remainder of the line as a comment.

Page 41: ABAP Day 1.1 - Overview

SAP AG

DATA: SUM TYPE P, " Totals fieldCOUNTER TYPE P.

* New account* Initialize totals field

CLEAR SUM.

Comments

Overview of ABAP/ Basic Syntax of ABAP

Page 42: ABAP Day 1.1 - Overview

SAP AG

R

System Fields

System fields

Name Type Length MeaningSY-DATUM DATE 8 DateSY-UZEIT TIME 6 TimeSY-UNAME CHAR 12 User IDSY-SUBRC HEX 2 Return codeSY-REPID CHAR 8 Program nameSY-LANGU CHAR 1 Logon language

.

.

.

for table structure SY

Overview of ABAP/ Basic Syntax of ABAP

Page 43: ABAP Day 1.1 - Overview

Overview of ABAP/ Basic Syntax of ABAP

SAP AG

REPORT RSAAA02C.WRITE: '******************************'.

SKIP 2.

WRITE: 'Date', SY-DATUM.WRITE: 'Time', SY-UZEIT.SKIP 2.WRITE: '******************************'.

ABAP/4 Programm Attribute

WRITE: Introduction 1

**********************************************Date 01.01.1996 Time 14:46:10

**********************************************

WRITE Statement

Page 44: ABAP Day 1.1 - Overview

Overview of ABAP/ Basic Syntax of ABAP

• WRITE outputs the contents of a field or constant in the format appropriate for the type.

• Consecutive WRITE statements output data on the same line. If there is no more space on one line, the output continues on the next line.

•SKIP generates blank lines.

•The ABAP/4 processor generates a standard header for each line. This consists of the list title, page number and an underline.

•Write Statement

Page 45: ABAP Day 1.1 - Overview

When you login to a SAP serverthe following screen appears

Page 46: ABAP Day 1.1 - Overview

Enter the user name & password

Page 47: ABAP Day 1.1 - Overview

This is the initial menu screen

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 48: ABAP Day 1.1 - Overview

This is the initial menu screen

Or Select TOOLSABAP/4 Workbenchfor going into programming area.

Enter SE38 in the space

Page 49: ABAP Day 1.1 - Overview

Introduction to ABAP/4 Editor

The ABAP/4 Editor is used to create new code or change existing code. The ABAP/4 editor can check to make sure you use the correct syntax in your program. Once your program is syntactically correct, you can generate, run, and debug your program from the Editor.

Page 50: ABAP Day 1.1 - Overview

You are in the Editor area

Page 51: ABAP Day 1.1 - Overview

Enter the Name of theProgram you want toStart.

Without giving a nameyou can not proceed.

The name shall start with Y or Z

Page 52: ABAP Day 1.1 - Overview

This screen prompts you to enter data

Page 53: ABAP Day 1.1 - Overview

Specifying the Program Attributes

To enter the program attributes, proceed as follows:1. Enter a title for the program in the field Title. Choose a title which describes the

function of the program.2. Complete the two mandatory fields:

If you are creating a report program, enter 1 in the Type field. If you are creating a module pool, enter M in the Type field. For a list of possible types, click the possible entries button.Enter the classification letter for your application in the Application field, e.g. F for Financial Accounting.

Page 54: ABAP Day 1.1 - Overview

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 55: ABAP Day 1.1 - Overview

Enter the following:

Title for the report Type : ExecutableApplication *

Press F11 for saving

Page 56: ABAP Day 1.1 - Overview

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

Page 57: ABAP Day 1.1 - Overview

The source code editor

Page 58: ABAP Day 1.1 - Overview

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 59: ABAP Day 1.1 - Overview

The first report output

Page 60: ABAP Day 1.1 - Overview

Congrats!

You have just become an ABAPer.

Page 61: ABAP Day 1.1 - Overview

Questions & Queries

Page 62: ABAP Day 1.1 - Overview

Thanks !!! & Lets Practice ***