Chapter 4 – Database accesses

Slides:



Advertisements
Ähnliche Präsentationen
OSGi ‘Enterprise expert group‘ workshop input
Advertisements

G21Billing Document Outbound via EDI Overview
G66 Empties Processing Overview
G20 Sales Order Processing via EDI Overview
SAP Best Practices Baseline Package U.S. Scenario Overview
J62 Buchungskreisübergreifende Auftragsabwicklung - Überblick
Muster- und Simulationskalkulation
Unternehmensstruktur Übersicht SAP Best Practices.
Account- und Kontaktmanagement
Manufacturing Analytics SAP Best Practices for Business Warehousing V2
Financial Accounting (J03) Overview Colombia
Transportation Management Overview (G82)
Systemüberblick Beispiele: Microsoft Access Oracle Ingres Informix
DESIGN MATTERS ESS Leave Request JBoss, Java Web-Technologies and Mule ESB Matthieu-P. Schapranow Walldorf, March 07th, 2007.
Filialwarenwirtschaft
DMS Modul Kurzvorstellung.
Task and Duty Modul Kurzvorstellung. Key Features Komfortables Benutzerinterface zur Wartung und Benutzung von Rechten und Pflichten. Such- und Beschlagwortungsmöglichkeit.
Leistungsvorstellung
How To Guide – Workflow BCS
ecount – Tipps und Tricks beim Importieren
Neues bei V1.603 SAP Best Practices for Chemicals (Deutschland) SAP Best Practices.
CEO Analytics SAP Best Practices for Business Warehousing V2.701
Interaktives Reporting SAP Best Practices for CRM
Operatives Berichtswesen für Tradingkontrakte
Voraussetzungen und Annahmen für die Aufwandsschätzung
Übersicht SAP AG.
DMS Modul Kurzvorstellung. Key Features Komfortables Benutzerinterface zur Wartung und Benutzung von in SAP Abgelegten Dokumenten. Such- und Beschlagwortungs-
G71 DSD „Daily Fresh“ Überblick
SAP Best Practices Prepackaged Industry & Cross-Industry Know-How Verfügbarkeit für SAP-Kunden und SAP-Partner.
J64 Production Planning and Discrete Manufacturing Overview
Title G81 - Integrated WM with PO Return. G81 - Integrated WM with PO Return / 2 Overview Scenario – Integrated WM In this scenario you are shown a complete.
SAP Best Practices Baseline Package U.S. Scenario Overview
Ventas y Distribución (J04) Overview Argentina SAP AG.
Martin Rink, SAP Trust Center Services SAP Trust Center Services SAP Passports - Scenarios of Usage.
Interaktives Reporting
Unternehmensstruktur Übersicht
Sprachneuerungen des .NET Frameworks 3.5
Financial Analytics SAP Best Practices for Business Warehousing V2.701 SAP Best Practices.
Purchasing Analytics SAP Best Practices for Business Warehousing V2.701 SAP Best Practices.
Erweiterte Kundenauftragsbearbeitung mit Vertriebsunterstützung und dynamischem Produktvorschlag SAP Best Practices.
Sales Analytics SAP Best Practices for Business Warehousing V2.701 SAP Best Practices.
SiPass standalone.
Interaction Center (IC) Serviceanforderungsmanagement SAP Best Practices.
Opportunity Management SAP Best Practices. ©2011 SAP AG. All rights reserved.2 Einsatzmöglichkeiten, Vorteile und wichtige Abläufe im Szenario Einsatzmöglichkeiten.
Eingehender Kundenauftrag via EDI
Arbeiten in einem agilen Team mit VS & TFS 11
Interaction Center Sales (mit ERP-Kundenauftrag) SAP Best Practices.
Reklamations- und Retourenabwicklung
? What is Open PS? SAP Open PS based on EPS 4.0
Integriertes Angebots- und Auftragsmanagement SAP Best Practices.
Gregor Graf Oracle Portal (Part of the Oracle Application Server 9i) Gregor Graf (2001,2002)
SAP and HERE IoT App Challenge - Use Case Template Please return to November 18, 2015.
Logistik Stammdatenaufbau Handel SAP Best Practices Baseline Package V1.605.
Quartalsplan – Absatzmengenprognose mit CO-PA SAP Best Practices.
BW Analytics SAP Best Practices. ©2011 SAP AG. All rights reserved.2 Einsatzmöglichkeiten, Vorteile und wichtige Abläufe im Szenario Einsatzmöglichkeiten.
Michael Becker SAP AG Betreuer: Sven Helmer
Systemkopie & Tablespace- Layout Claudia Schulz Landscape, Implementation/Development, SAP AG.
SAP and Zebra Zatar Use Case Template. ©2016 SAP SE. All rights reserved. Use Case Description 1/3 Company name Main contact name Project type Solution.
CEO SAP Best Practices for Business Intelligence SAP Best Practices.
Service SAP Best Practices for Business Intelligence SAP Best Practices.
Custom error page for timeout Gergely Andó / Application Innovation July 10, 2013 Customer.
The IT–Information System
Chapter 6 – Specialities for ERP software
Chapter 10 – Subscreens, tabs and HTML viewer
Chapter 2 – Tools in the development environment
Chapter 5 – Dynamic programs
Chapter 1 – Introduction and first program
Szenarioübersicht Terminierung mittels Rechnungen und Nachberechnung.
Metadata - Catalogues and Digitised works
- moodle – a internet based learning platform
 Präsentation transkript:

Chapter 4 – Database accesses ABAP Course Chapter 4 – Database accesses Lecturer: André Bögelsack, UCC Technische Universität München Author: Valentin Nicolescu, André Bögelsack

Copyright 2008 UCC TU München All rights reserved Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche Genehmigung durch HCC TU München nicht gestattet. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden. Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® und SQL Server® sind eingetragene Marken der Microsoft Corporation. IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®, AS/400®, OS/390® und OS/400® sind eingetragene Marken der IBM Corporation. ORACLE® ist eine eingetragene Marke der ORACLE Corporation. INFORMIX®-OnLine for SAP und Informix® Dynamic ServerTM sind eingetragene Marken der Informix Software Incorporated.  UNIX®, X/Open®, OSF/1® und Motif® sind eingetragene Marken der Open Group. Citrix®, das Citrix-Logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®, VideoFrame®, MultiWin® und andere hier erwähnte Namen von Citrix-Produkten sind Marken von Citrix Systems, Inc. HTML, DHTML, XML, XHTML sind Marken oder eingetragene Marken des W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.   JAVA® ist eine eingetragene Marke der Sun Microsystems, Inc. JAVASCRIPT® ist eine eingetragene Marke der Sun Microsystems, Inc., verwendet unter der Lizenz der von Netscape entwickelten und implementierten Technologie.   SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP, mySAP.com und weitere im Text erwähnte SAP-Produkte und -Dienstleistungen sowie die entsprechenden Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und anderen Ländern weltweit. MarketSet und Enterprise Buyer sind gemeinsame Marken von SAP Markets und Commerce One. Alle anderen Namen von Produkten und Dienstleistungen sind Marken der jeweiligen Firmen. Die Verwendung der Screenshots wurde mit dem jeweiligen Eigner abgesprochen.

Agenda Data dictionary SAP flight example Database operations in SAP SAP OpenSQL Types of database changes Types of entry help

Data dictionary Data dictionary = global directory for data types Assignment of help texts and explanations for data types in different languages ERM can be shown as a figure automatically Most important objects: structure, table, data element and domain

Data dictionary Field Field Field Domain ZY_ID INT4 Data type Data element ZY_ID ZZ_ID Field ZY_ID ZZ_ID Field Structure Table Field Field

Data dictionary Menu path: Tools • ABAP Workbench • Development • Dictionary TA SE11 View, edit, delete, create tables, data types, domains definitions etc. Tables and views from the ABAP dictionary represent tables and views from the database User interface are generated automatically when changing views, tables etc. Table may be changed after they are created without losing data SAP tables may be extended by APPEND structures

Data browser Menu path: Tools • ABAP Workbench • Overview • Data Browser TA SE16 View table content Add new entries to tables when adding is permitted for the table Browse the entry help table content Copy table content to transport request Download table content

Overview about all objects Database table View Data type Data element Structure Table types Views Class / interface Type group Domain Search help Lock object

Visualization Foreign key relationships can be visualized in data dictionary Table SFLIGHT

SAP flight example Created and maintained by SAP to demonstrate database operations Contains exercise data for airline, flight connection number, flight date, airfare etc. Report for data generation: S_FLIGHT_MODEL_DATA_GENERATION SAP trainings, examples from books build refer to the flight example

SAP flight example – table structure Connection Flight Reservation Plane SPFLI SFLIGHT SBOOK SAPLANE MANDT MANDT MANDT MANDT CARRID CARRID CARRID PLANETYPE CONNID CONNID CONNID SEATSMAX AIRPFROM FLDATE FLDATE TANKCAP AIRPTO SEATSMAX BOOKID CAP_UNIT CITYFROM SEATSOCC CUSTOMID WEIGHT CITYTO PRICE LUGGWEIGH WIE_UNIT COUNTRYFR CURRENCY WUNIT OP_SPEED COUNTRYTO PLANETYPE CANCELLED SPEED_UNIT … … … …

SAP OpenSQL Independent from database Application Server Database Server ABAP-Interpreter DB-Interface SQL-Database Select * from OpenSQL Native SQL DB data DB data Data Exec SQL. Select * from End Exec. Native SQL DB data

OpenSQL instructions Select: Aggregation: Joins: SELECT / SELECT SINGLE * / field 1 ..field n / FROM table / view INTO structure / internal table WHERE condition Aggregation: MAX, MIN, AVG SUM, COUNT Joins: Left outer join Inner join View

Procedure for database access General: Be specific to decrease the load on the database Access to database takes 10,000 time longer than access to buffers Avoid table scans, use indexes Procedure: Read database data into internal tables Internal tables are tables for holding data during runtime Change data per row Use workareas to hold one row of the table and change data in the workarea Write changes back to database

Procedure for database access Internal tables and workareas: wa_spfli LH 0400 Workarea (one row) Use the workarea to modify one data set it_spfli Use the internal table to store the selected database content temporarily Internal tables are deleted after program is finished AA 0017 LH 0400 Internal table (selected content) Database Database table (whole content) Use the database to read/write data

Types of database changes Modify instruction: MODIFY <dbtable> [CLIENT SPECIFIED] FROM <workarea>. MODIFY <dbtable> [CLIENT SPECIFIED] FROM TABLE <internaltable> Modify = Update – the command updates the database table if the database table already contains dataset Modify = Insert – the command inserts new datasets into the database table Delete instruction: DELETE FROM <dbtable> WHERE [SQL statement].

Entry help Entry help uses a table in the background Predefined entry help for a table