You are on page 1of 19

IBM Global Services

Advanced ALV with ABAP Objects

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Objectives
The participants will be able to:
Get overview of dialog program
Discuss classical list programming as related to ABAP objects Review SAP Control Framework (CFW)

Build dialog program using ABAP Objects and custom controls


Creating a screen with a control

Dialog Modules
GUI Status Passing Data Using Classes Creating Objects

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

SAP Control Framework (CFW)


Automation Controller

Events
Instance Automation Queue

Custom Control 1 Custom Control 2

SAPGUI(frontend)

OK_CODE

GUI RFC

Application Server (Backend)

OO Control Framework

Automation Queue Events Instance

Application Program

In the R/3 System, you can use ABAP to control desktop applications (custom controls). The application logic runs on the R/3 application server (automation client), which drives the custom control (automation server) at the frontend. The ability to use these custom controls has been built into the dialog process between SAPGui screens and application programs. Custom controls can be added in the screen painter.
3 Advanced ALV with ABAP Objects | 5.04 March-2005

2005 IBM Corporation

IBM Global Services

Classical List Report Programming vs. ABAP Objects


How is the end result displayed by this program different from a standard list report displaying data from table SAPLANE ?

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Overview of a Dialog Program with Custom Controls


Create a simple dialog program to display Plane information Specifications:
Launch via transaction code
Display all columns from table SAPLANE Display rows based on user input Aircraft Type (PLANETYPE) Use single screen to display data with menu controls to back out of the screen Use custom control to display the data in SAP List Viewer (ALV) format

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Integrating a Control Area into a Dynpro Screen


Using the screen painter the developer can place custom controls on SAP screens. The custom control area is given a name that identifies it. In this example it will be LIST_AREA Within the application program, the developer calls proxy objects from within the superclass CL_GUI_CONTROL For each control, a container object and an application object must be created To create a container object specifically for the ALV viewer, feed the screen name of the custom control (LIST_AREA) to the constructor of the container object For this dialog program, the class CL_GUI_ALV_GRID will be used to create the viewer

The dialog program will feed the SAPLANE data to the ALV object which will be displayed in the custom control are as an ALV grid

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

SAP Control Framework Wrapper Classes for GUI Controls


CL_GUI_OBJECT

CL_GUI_CONTROL

CL_GUI_FRONTEND_SERVICES

CL_GUI_CONTAINER CL_GUI_CUSTOM_CONTAINER CL_GUI_SPLITTER_CONTAINER CL_GUI_DIALOGBOX_CONTAINER CL_GUI_ALV_GRID_BASE CL_GUI_ALV_GRID CL_GUI_HTML_VIEWER CL_TREE_CONTROL_BASE CL_GUI_SIMPLE_TREE

Methods FILE_OPEN_DIALOG GET_DESKTOP_DIRECTORY GUI_UPLOAD GUI_DOWLOAD .

CL_GUI_PICTURE

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Create the Program and Screen


Step 1 : First create a program using SE80 (Object Navigator) Step 2 : Create a Screen for the program using : SE80 ->Program->Right click on program name->select Screen

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Create Custom Control


Step 3 : Create an Input Field and a Custom Control in the Screen

Input Field

Custom Control Area

Custom Control

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Create GUI Status


Step 4 : Create GUI Status to add the exit capability

10

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Create Transaction Code and Define Class


Step 5 : Create a transaction code to execute the dialog program

Step 6 : Define a class to perform the data retrieval and formatting to the screen

11

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Creating Objects for the Class


Step 7 : Create Object for the Class to Implement the methods and displaying the ALV Grid Control with desired functionality.

12

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration : Result

13

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Container Controls
SAP Custom Container SAP Dialog Box Container SAP Docking Container SAP Splitter Container SAP Easy Splitter Container

14

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Container Controls (Contd.)

SAP Custom Container SAP Dialog Box Container SAP Docking Container SAP Splitter Container SAP Easy Splitter Container

15

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Demonstration
Create a simple ALV report using OOPs concept

16

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Practice
Create a simple ALV report using OOPs concept

17

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Summary
Description of SAP Control Framework.

Different classes required for various containers..


Purpose of different containers. How to handle Events in ALV. Steps to create an ALV report using OOPs concept.

18

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

IBM Global Services

Questions
What is SAP Control Framework?

What is container control? What are their types?


Which class encapsulates the functionality of ALV grid in OOPs? What are the steps required to build an ALV report using OOPs concept ?

19

Advanced ALV with ABAP Objects | 5.04

March-2005

2005 IBM Corporation

You might also like