Alv Templet (Using Oops)

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

ALV TEMPLATE USING OOPS

ALV Template
Using OOPS

PREPARED BY : HARIPRASAD

TABLE OF CONTENTS

WIPRO Technologies WIPRO Confidential Page 1


ALV TEMPLATE USING OOPS

APPENDIX ....................................................................................................................................................9
GLOSSARY..............................................................................................................................................9
APPENDIX ....................................................................................................................................................9
GLOSSARY..............................................................................................................................................9

WIPRO Technologies WIPRO Confidential Page 2


ALV TEMPLATE USING OOPS

1. INTRODUCTION.
This document contains brief information about ALV, object oriented programming in
ABAP. A template program of ALV written using OOP.

A reader get make you of this template program for the simple ALV, Interactive ALV
and Editable ALV requirements. This document explains every steps as per the programmers
point of view.

Pre requirements for ALV programming is knowledge of OOP concept. Therefore


initially I explained the information about ALV and then concept of OOP's required for this
template. Let us start the journey of this ALV.

WIPRO Technologies WIPRO Confidential Page 3


ALV TEMPLATE USING OOPS

2. INFORMATION ON ALV AND OOP's.

2.1 What is ALV ?


ALV - ABAP List Viewer.
“The ALV Grid control is a flexible tool for displaying lists. The tool provides common list
operations as generic functions and can be enhanced by self-defined options.” The ALV Grid
control is used to build non-hierarchical, interactive, and modern-design lists.

The ALV grid control provides typical list functions as Sorting, Filtering, Summing, etc.,
while also give the opportunity to develop user functions where needed.

As per the end-user perspective, It is an UI element, which is for displaying tabular data and
provides standard functionality like sorting, filtering, subtotal, choose columns, persistence of
settings, etc.

As per the developers perspective, It is a set of APIs, can be used in any application and
offers the rendering functionality of tabular data. It also provides generic services like sorting,
etc.
Generic services can be enhanced by application specific functionality. It supports different
flavors of presentation.

Reporting with ALV, we can get the following extra features compare to normal list display.
1. Standard data interface.
2. Function tool bar.
3. Displaying of data in the customized fashion.
4. Heading or Title.
5. No limit of GUI.
6. Programming of additional functionality as per the user requirement.

We have 2 main category of list based on the ABAP list processor and SAP control framework.

WIPRO Technologies WIPRO Confidential Page 4


ALV TEMPLATE USING OOPS

1. ABAP list processor based.


1. Simple list.
2. Hierarchical sequential list.
2. SAP Control Framework based.
1. Display as Full screen.
• Grid (Simple list).
• Tree(New in SAP NetWeaver2004!).
2. Display in a container (part of a dynpro).
• Grid (Simple list).
• Tree.

In other way, using ALV, we can have 4 types of reports:


1. Simple Report.
2. ALV grid Report
3. Block Report.
4. Hierarchical Sequential Report.

In this document, we are going to deal with ALV grid report.

2.2 Object oriented programming in ABAP.

WIPRO Technologies WIPRO Confidential Page 5


ALV TEMPLATE USING OOPS

Object orientation or object-oriented programming, is a problem-solving method in which the


software solution reflects objects in the real world.

Objects:
Objects represent abstract or concrete objects of the real world. An object is a section of program
code that has data (called attributes) and provides services called methods (sometimes also
known as operations or functions). Methods typically work with private data in the object
(attributes, also known as the object state), that are only visible within the object. This
guarantees the internal consistency of the object, since the data is only changed
by the methods, not by the user. This ensures that the object is consistent in itself.

Classes

Classes are program code that describes objects. Technically, an object is an instance
of a
class. In theory, you can create an infinite number of objects from a single class
definition. Each instance of a class (object) has its own values for its attributes.
Object References

In a program, you identify and address objects using a unique object reference. They
allow
you to access the attributes and methods of an object.
In object-oriented programming, objects usually have the following characteristics:

Encapsulation

Objects restrict the external visibility of their resources (attributes and methods). Each
object
hat an interface that determines how other objects or applications can use it. The
implementation of the object is encapsulated (not visible outside the class).

Polymorphism

Methods with the same name can behave differently in different classes. In object-
oriented
programming, you can use interfaces to address methods with the same name in
different
objects. The form of address always remains the same, but the actual method
implementation is class-specific, and can be different in each class.

Inheritance

You can derive a class from another class. A derived class (subclass) inherits the data
and

WIPRO Technologies WIPRO Confidential Page 6


ALV TEMPLATE USING OOPS

methods of its superclass. You can add new methods to a subclass, or redefine existing
methods. Redefined methods have the same name and interface as the original
method.
Their classes are therefore polymorphous, too.

Uses of Object Orientation

Object-orientation has the following advantages:

o Complex software systems become easier to understand, since an object-oriented


architecture
resembles reality more closely than other programming techniques.

________________________________________________________________
2 16.06.2005 SAP AG

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/3 System
________________________________________________________________

o Changes in object-oriented systems should be possible locally (at class level),


without further
changes being necessary in other parts of the system. This reduces the amount of
maintenance
required.

WIPRO Technologies WIPRO Confidential Page 7


ALV TEMPLATE USING OOPS

o Polymorphism and inheritance enable many individual components to be reused.

o Object-oriented systems require less adjustment and maintenance, because the


majority of
problems can be discovered and corrected in the design and development phases.

Achieving these goals requires:

o Object-oriented Programming Languages

Object-oriented programming techniques do not necessarily require object-oriented


programming
languages. However, they do depend on the implementation of object-oriented
constructions in
the system kernel.

o Object-oriented Tools

Object-oriented tools help you create object-oriented programs in object-oriented


languages.
They allow you to store and visualize your program objects and the relationship
between
them.

o Object-oriented Modeling

Object-oriented modeling of a software system is the most important, most time


consuming,
and most difficult task required to achieve the above goals. Object-oriented design
encompasses
more than just object-oriented programming, and offers logical advantages that are
independent
of the eventual implementation.

WIPRO Technologies WIPRO Confidential Page 8


ALV TEMPLATE USING OOPS

APPENDIX

Glossary

1. SAP System Application and Products


2. ABAP Advanced Business Application Programming
3. PAI Process After Input
4. PBO Process Before Output
5. RFC Remote Function Call
6. BAPI Business Application Programming Interface
7. DBMS Database Management System
8. OSS Online Support Services
9. GUI Graphical User Interface
10. DDIC Data Dictionary
11. R/3 Release 3.0

WIPRO Technologies WIPRO Confidential Page 9

You might also like