Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
grid.pdf
Скачиваний:
49
Добавлен:
21.05.2015
Размер:
795.44 Кб
Скачать

An Easy Reference for ALV Grid Control

SDN Community Contribution (This is not an official SAP document.)

Disclaimer & Liability Notice

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

© 2005 SAP AG

1

An Easy Reference for ALV Grid Control

Applies To:

ALV Grid control can be used as of release 4.6C. Besides consider the following official note while utilizing this control:

SAP does not guarantee that the methods, events and attributes of this class that are not public will remain unchanged or will be available in future releases. This is why you should not derive the class to access protected objects of the class. Using these objects makes it more difficult to upgrade to subsequent releases.

Summary

Purpose of this tutorial is to provide an easy and quick reference which may be used as a guide while coding to build lists using ALV Grid Control. Actually, there is easy-to-reach information about implementing ALV Grid lists. However, it is generally required to find the information sought in a quicker way. This tutorial handles this, being a condensed source which can be used as a “guide”. It will not deal with the technical infrastructure on which ALV lays. Some of the tables are taken from the online SAP Library which is the most trustable source about the topic. Shortly, this will be a booklet summarizing major capabilities of the ALV Grid Control.

To get deep into the ALV Grid control, you can refer to the standard SAP course “BC412 – ABAP Dialog Programming Using EnjoySAP Controls” and the book “Controls Technology”. Also you had better inspect demo programs.

By: Serdar ŞİMŞEKLER

Company and Title: Havelsan Inc., SAP Application Developer

Date: 24 Oct 2004

Updated on 27 June 2005

Updated on 16 August 2005

Prerequisites

To use ALV Grid Control in a simple manner, it will be sufficient just having experience on dialog programming. However, to make use of more capabilities, it is required some knowledge on objectoriented perspective of ABAP programming. A general knowledge on control framework is supposed to exist.

© 2005 SAP AG

2

An Easy Reference for ALV Grid Control

Table of Contents

DISCLAIMER & LIABILITY NOTICE

 

1

APPLIES TO:

 

2

SUMMARY

 

2

PREREQUISITES

 

2

TABLE OF CONTENTS

 

3

INTRODUCTION

 

5

BUILDING BLOCKS

 

5

GENERAL SCHEME

5

BUILDING FIELD CATALOG

12

STRUCTURE OF A FIELD CATALOG

12

BUILDING FIELD CATALOG MANUALLY

15

BUILDING FIELD CATALOG SEMI-AUTOMATICALLY

16

LAYOUT ADJUSTMENTS

18

PRINTING ADJUSTMENTS

21

EXCLUDING UNWANTED STANDARD FUNCTION BUTTONS

22

NON-EVENT BASED ADDITIONAL FUNCTIONALITIES

 

23

CHANGING FIELD CATALOG OR LAYOUT AFTER FIRST DISPLAY

23

SETTING SORT CONDITIONS

24

FILTERING

25

MAKING SELECTIONS

25

RETRIEVING AND SETTING SCROLL STATUS INFO

27

COLORING

27

COLORING AN ENTIRE COLUMN

27

COLORING AN ENTIRE ROW

28

COLORING INDIVIDUAL CELLS

28

INSERTING HYPERLINKS

29

MAKING FIELDS AS DROPDOWN LISTS

31

MANAGING DISPLAY VARIANTS

33

© 2005 SAP AG

3

An Easy Reference for ALV Grid Control

EVENT BASED ADDITIONAL FUNCTIONALITIES

34

GENERAL SCHEME FOR THE EVENT HANDLER CLASS

36

HOTSPOT CLICKING

39

DOUBLE CLICKING

40

PUSHBUTTONS ON THE LIST

41

ADDING YOUR OWN FUNCTIONS

42

OVERRIDING STANDARD FUNCTIONS

45

CONTEXT MENUS

45

ABOUT PRINTING

46

MAKING ALV GRID EDITABLE

47

CONTROLLING DATA CHANGES

49

LINKING F1 HELP TO FIELDS

51

LINKING F4 HELP TO FIELDS

51

A PIECE OF TROUBLESHOOTING

 

53

AUTHOR BIO

 

54

© 2005 SAP AG

4

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]