Sei sulla pagina 1di 26

SAP ABAP

SAP ABAP/4

www.iteanztechnologies.com

SAP R/3 Architecture R/3 System Service Layers SAP R/3 is SAPs Integrated software solution for client/server and distributed open systems.

www.iteanztechnologies.com

What is SAP ABAP


ABAP: Advanced Business Application Program.

ABAP/4 Programming
ABAP 4 is the programming language used to code SAP R/3. There are three main components of the ABAP 4 language. These are

o ABAP 4 Development Workbench o ABAP 4 Data Dictionary o ABAP 4 Repository Information

www.iteanztechnologies.com

ABAP 4 Development Workbench: The development workbench gives access to SAP's development tools. ABAP programmers use the development workbench to write programs in SAP. ABAP 4 Data Dictionary: Definitions of variables and parameters on the other hand are stored in the data dictionary. ABAP 4 Repository Information: Any program developed in ABAP is stored in the R/3 repository.

www.iteanztechnologies.com

ABAP Technologies

Different ABAP technologies are introduced to build business application for different purposes. In the traditional ABAP development, there is a word RICEF-W which stands for o Reports o Interfaces o Conversions o Enhancements o Forms o Workflow.

www.iteanztechnologies.com

Objectives

It consists of the following applications/sub modules/screens:


o o o o o o o o o ABAP Data Dictionary ABAP Reports Module pool Programming Batch Data Communication (BDC) Smart forms, Scripts Enhancements BADIs BAPI ALE IDOCs

www.iteanztechnologies.com

ABAP Data Dictionary

The ABAP Dictionary centrally describes and manages all the data definitions used in the system. The ABAP Dictionary is completely integrated in the ABAP workbench.

Purpose:
Data definitions (meta data) are created and managed in the ABAP Dictionary. The most important object types in the ABAP Dictionary are o o o o o o Tables Structures Views Types Data elements Domains Modularization techniques Search helps Lock objects

www.iteanztechnologies.com

ABAP Data Dictionary

Table:
Represent the Database Tables where data actually resides. Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) SAP ABAP data types and lengths.

Data element:
Fields of same semantic meaning can refer to the same data element Contains the field information

Domain:
Describes the technical characteristics of a table field Specifies a value range which describes allowed data values for the fields Ensures consistency

www.iteanztechnologies.com

Types:
A data type is the users view on the data; i.e. the data format at the user interface. You can enter any of the existing data types for the data dictionary, such as ACCP, CHAR, CLNT, or NUMC.

Structure:
Just like user-defined data type.

Structures contain data only during the runtime of a program.

Search help:
A Search help is a tool to help you search for data records in the system Search help is for F4 help Two types of Search help we have Elementary Search help Collective Search help

www.iteanztechnologies.com

Lock objects:
Simultaneous accessing of the same data record by two users in the SAP system is synchronized by a lock mechanism. Locks are set and released by calling certain function modules. These function modules are generated automatically from the definition of socalled lock objects in the ABAP/4 Dictionary

Function modules :
Enqueue_<obj name> to lock the table dequeue_<obj name> to release the lock

Views:
Views in SAP _ ABAP are used to summarize data which is distributed among several tables . The data of a view is not actually physically stored. The data of a view is instead derived from one or more other tables

www.iteanztechnologies.com

Modularization :
Modularization Improves the Re-usability and Readability of the source code.
Modularization techniques: Function Modules Subroutines Methods (OOABAP) Macros (HR ABAP) Include programs

www.iteanztechnologies.com

Important Transactions

SE11 : Data Dictionary Initial Screen (SE12 Display only) SE13 : ABAP Dictionary : Technical Settings SE14 : Database Utility SE15 : Repository Information System SE16 : Data Browser SE17 : General table Display SE55 : Table View Maintenance SM30 : Table Maintenance

www.iteanztechnologies.com

ABAP Reports

Report is displaying the application data in the required format. Technically speaking report is an executable programming with three stage function. Data Input ( selection Screen ) Data Processing ( Select Statement ) Data Output ( Output data )

Purpose:
It helps to analyze the current situation and for decision making There are 3 type of reports: Classical Interactive ALV Reports (ALV stands for ABAP List Viewer)

www.iteanztechnologies.com

Classical Reports
These are the most simple reports. Programmers learn this one first. It is just an output of data using the Write statement in side a loop. Classical reports are normal reports. These reports are not having any sub reports. INTIALIZATION: This event triggers before selection screen display. AT-SELECTION-SCREEN: This event triggers after processing user input still selection screen is in active mode. START OF SELECTION: Start of selection screen triggers after proceesing selection screen. END-OF-SELECTION : It is for Logical Database Reporting. TOP-OF-PAGE: when the first write statement is trigger this event will trigger.

Events In Classical Reports:


www.iteanztechnologies.com

Interactive Reports
To displays the secondary list data AT LINE-SELECTION : This Event triggers when we double click a line on the list, when the event is triggered a new sub list is going to be generated. AT PF: For predefined function keys... AT USER-COMMAND: It provides user functions keys., and to validate the user function keys TOP-OF-PAGE DURING LINE-SELECTION : Top of page event for secondary list. HIDE statement holds the data to be displayed in the secondary list.

Interactive Report Events:

www.iteanztechnologies.com

ALV

ALV: ABAP List Viewer Standard FM: Reuse_alv_list_display Reuse_alv_grid_display Reuse_alv_Fieldcatalog_merge

OOALV: CL_gui_customer_container Lvc_alv_list_display Lvc_alv_grid_display Set_table_for_first _display

www.iteanztechnologies.com

Module pool
Module pool:
Its Nothing but Dialog programming.

Process Before Output(PBO)


After it has processed all of the modules in the PBO processing block, the system copies the contents of the fields in the ABAP work area to their corresponding fields in the screen work area.

Process After Input(PAI)


Before it processes the first module in the PAI processing block, the system copies the contents of the fields in the screen work area to their corresponding fields in the ABAP work area. Process On help request Process in value request

www.iteanztechnologies.com

How to Create Dialog Program

Transaction SE80 : Create Dialog Program Create Screen(4 steps) Screen Attribute Screen Layout Flow Logic(PBO,PAI) Define Variable ok_code in Element List Define Data Object in ABAP Work Area at TOP Include(Tables, Data,...) Check and Activate Dialog Program Create Transaction Code

www.iteanztechnologies.com

Dialog Program Components

Transaction Code

Dialog Program

Program Naming Convention : SAPM

Screen : 100 (Screen Layout) Flow Logic

PBO

ABAP Module Pool

PAI

ABAP Module Pool

PBO Screen : 200 (Screen Layout) Flow Logic PAI

ABAP Module Pool

ABAP Module Pool

www.iteanztechnologies.com

BDC (Batch Data Communication)


When SAP is implemented we need Data to migrate from non-SAP system i.e. Legacy system to SAP system. One way of doing this is BDC (Batch Data Communication). Three ways do the transfer data in BDC Direct input method Batch input method Call Transaction method Session Method

BDC Data Structure:


PROGRAM DYNPRODYNBEGINFNAMFVALBDC module pool BDC Screen number BDC screen start Field name BDC field value

www.iteanztechnologies.com

Smart Forms

Smartform:
SAP Smart Forms is sap new print solution introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms to print the business documents. SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools.

Tcode:
SMARTFORMS

Types of windows:
Main Window Secondary Window Copies Window Final Window .
www.iteanztechnologies.com

Smart form standard FM:


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'ZZ_SFORM' * VARIANT ='' * DIRECT_CALL ='' IMPORTING FM_NAME = LV_FMNAM * EXCEPTIONS * NO_FORM =1 * NO_FUNCTION_MODULE =2 * OTHERS =3

www.iteanztechnologies.com

BAPI

BAPI stands for Business Application Programming Interface. It is a precisely defined interface providing access BAPIs can be called within the R/3 System from external application systems and other programs. The Business Object Repository (BOR) is the object-oriented repository in the R/3 System. It contains the SAP business object types and SAP interface types as well as their components, such as methods, attributes and events.

Business Object repository:


Tcode: SWO1

www.iteanztechnologies.com

Enhancements

Enhancements:
To add our own functionality to the standard SAP s/w with out modifying the original coding. Enhancement use the procedural programming technique to implement the enhancement Implicit Enhancement Explicit Enhancement

BADI:
Business Add-Inns are SAPs enhancement technique which is used after 4.6 version of ECC. BADIs are reusable components, which is developed in OO-ABAP
SE18-> Find the BADI SE19-> Implement the BADI

www.iteanztechnologies.com

Enhancement Overview

Enhancement Approach

Procedural User Exit For SD module Std/: Include (MV45AMZ) Subroutine Implementation Customer Exit Screen Exit Menu Exit FM Exit Locating Exit

objectoriented BADIs

FM Implementation

www.iteanztechnologies.com

Conclusion

This ppt was aimed to cover the fundamentals of the ABAP programming language .

www.iteanztechnologies.com

Potrebbero piacerti anche