You are on page 1of 39

SAPs Data Dictionary

Learning to use it effectively

FSS Technical Peer Group Meeting Wednesday November 13, 2002 Carolyn Fuller

Introduction
To know an application is to know its data Data dictionary holds key to performance Data dictionary tools reduce custom programming

FSS Technical Peer Group Meeting

2 11/13/2002

Agenda
The SAP Data Model Data Filtration SAP Indexes Building Custom Tables/Simple Apps

FSS Technical Peer Group Meeting

3 11/13/2002

Vocabulary

Relational Database Indexes Unique Index Primary Key Foreign Key (Check Table) One-to-Many Relationship Recursive Relationship Client Dependent View Cluster
4 11/13/2002

FSS Technical Peer Group Meeting

KNA1
KUNNR

KNB1

The Data Model


BKPF
BUKRS BELNR GJAHR

BUKRS KUNNR

BSID

BUKRS KUNNR..

BSAD

BUKRS KUNNR..

BSEG PRPS ZSDBHEAD


PRIME_CONTRACT PSPNR STUFE FAKKZ

BUKRS BELNR GJAHR BUZEI

ZSDBLINE
PRIME_CONTRACT MATERIAL

FSS Technical Peer Group Meeting

5 11/13/2002

The SAP Data Model


Transactional Data One-to-Many


One header row to many line items

Master Data One-to-Many


One master to many company code masters One master to many transaction line items

Recursive data
One parent to many children & grandchildren

FSS Technical Peer Group Meeting

6 11/13/2002

Report Example
Headers

Line Items

FSS Technical Peer Group Meeting

7 11/13/2002

One Should be Driver


All the WBS (billable and non-billable) Each WBS looks up its parent

Billable WBS

Billable WBS finds children, grandchildren

FSS Technical Peer Group Meeting

8 11/13/2002

Recursive Relationship
Billing Element

Billing Element

FSS Technical Peer Group Meeting

9 11/13/2002

PRHI - WBS Edges


WBS 6900000 6900027 6900028 6900029 6900030 6900037 6900038 Project 6900000 6900000 6900000 6900000 6900000 6900000 6900000 6900000 6900027 6900028 6900028 6900000 6900037 6900038 6900039 UP DOWN 6900054 6900028 6900040 6900030 6900040 6900054 6900029 6900027 6900037 xxxxxxx LEFT RIGHT

6900039
6900040 6900054 6900055

6900000
6900000 6900000 6900000

6900038
6900028 6900000 6900054 6900055 6900030 6900037

FSS Technical Peer Group Meeting

10 11/13/2002

Filtering Data Billing Example

Move filter to beginning of program

FSS Technical Peer Group Meeting

11 11/13/2002

Filtering Data MM Example


Unfiltered

Filtered
12 11/13/2002

FSS Technical Peer Group Meeting

SAP Indexes
Primary Key Secondary Indexes Secondary Index Tables Foreign Key

FSS Technical Peer Group Meeting

13 11/13/2002

Secondary Index Table


Primary Key & Unique Index

Secondary Indexes

Foreign Key

Client

Foreign Keys Check Table

FSS Technical Peer Group Meeting

14 11/13/2002

BSIDs Secondary Indexes


Unique flag

BSID-1 Index for logical database


15 11/13/2002

FSS Technical Peer Group Meeting

Recursive Resolution Table


Foreign Keys

Check Tables

FSS Technical Peer Group Meeting

16 11/13/2002

BKPF Primary & Foreign Keys


Primary Key with Foreign Key Primary Key Foreign Key Table Fields

FSS Technical Peer Group Meeting

17 11/13/2002

COVP Useful Secondary Index

WBS 4579002

FSS Technical Peer Group Meeting

18 11/13/2002

COVP Primary & Foreign Keys


Primary Key with Foreign Key Table Fields

Primary Key

Foreign Keys

FSS Technical Peer Group Meeting

19 11/13/2002

Additional Useful Indexes


http://fuller.mit.edu/SAPDocs/indexes.htm

FSS Technical Peer Group Meeting

20 11/13/2002

Building Custom Tables

Create Header Table Create Line Item Table Create Maintainable Views for Header & Items SE54 - Extended Table Maintenance for Views Program & Activate Event User Exits
Data validations

SE54 - Create View Cluster SM34 - Maintain View Cluster


SF8 View Cluster name is ZSDBLINE_VC

FSS Technical Peer Group Meeting

21 11/13/2002

Create Header Table


Client Search help can be attached to Field or Field type Custom field type allows custom documentation

FSS Technical Peer Group Meeting

22 11/13/2002

Custom Search Help


Defined in Data type

Function Module

Will display contract # and customer PO

Defined in Search help

FSS Technical Peer Group Meeting

23 11/13/2002

Custom Field Documentation


Defined in Data type

FSS Technical Peer Group Meeting

24 11/13/2002

Create Line Item Table


Foreign Key

Foreign Keys Check Table

FSS Technical Peer Group Meeting

25 11/13/2002

Create Maintainable View


Not the default!

FSS Technical Peer Group Meeting

26 11/13/2002

View Fields

Maintenance Attribute (MF)

Header fields - S will be read only on line items


FSS Technical Peer Group Meeting 27 11/13/2002

Extended Table Maintenance


SE54 - Generated Objects
Maintainable View

Create an Include via SE38

FSS Technical Peer Group Meeting

29 11/13/2002

Modify Function Pool


SAPLfunction_group

Uncomment

FSS Technical Peer Group Meeting

30 11/13/2002

Modify Lfunction_groupFXX
SE80 - Function group

FSS Technical Peer Group Meeting

31 11/13/2002

Events
SE54 -> Environment -> Events

Create View Cluster


SE54 -> Edit viewcluster

Object structure

FSS Technical Peer Group Meeting

34 11/13/2002

Generated Field Dependences


Header - ZSDBHEAD_V

FSS Technical Peer Group Meeting

35 11/13/2002

Generated Field Dependences


Header - ZSDBLINE_V

FSS Technical Peer Group Meeting

36 11/13/2002

View Cluster - Line Items SM34

Header

Line Items

FSS Technical Peer Group Meeting

37 11/13/2002

Summary

Know your program driver


Find the One in the application data model

Filter the data early in the program Know the indexes available in an area
If you cant use the primary index there are usually other indexes

Use the SAP supplied tools when possible


38 11/13/2002

FSS Technical Peer Group Meeting

Where to Get More Information

BC430 ABAP Dictionary


Tomorrow in Waltham (11/14 - 11/15) January 9 - 10, 2003 Waltham

My personal favorite, the book


Object-Oriented Systems Analysis - Modeling the World of Data by Sally Shlaer & Stephen Mello

Available, used on www.amazon.com


39 11/13/2002

FSS Technical Peer Group Meeting

You might also like