This document discusses special topics for ERP software development in ABAP, including authorizations, locking objects, logical units of work, and updaters. Authorizations must be checked before programs access data. Locking objects prevent simultaneous changes to shared data. Logical units of work ensure data integrity by buffering database updates and only committing them when a transaction is complete. Updaters process the buffered updates and write them to the database.
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Abap course chapter 6 specialities for erp software
1. ABAP Course
Chapter 6 – Specialities for ERP software
Lecturer: André Bögelsack, UCC Technische Universität München
Author: Valentin Nicolescu, André Bögelsack
ABAP Course André Bögelsack, Valentin Nicolescu 1
2. 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.
ABAP Course André Bögelsack, Valentin Nicolescu 2
3. Agenda
1. Authorizations
2. Lock objects
3. Logical units of work
4. Updater
ABAP Course André Bögelsack, Valentin Nicolescu 3
4. Authorizations
• Before starting a program user authorizations should always be
checked
• But: authorizations are not checked by the system
• Every ABAP program has to check authorizations by itself
• Different authorization levels: READ (01), CHANGE (02), DELETE
(03) for every data set
• Transaction: SU03
ABAP Course André Bögelsack, Valentin Nicolescu 4
5. Locking concept
• What happens when several users want to work on the same
data set? data inconsistency
• Lock objects prevent simultaneous changes on data set
• Beside the lock concept of the database, SAP implements its own
lock concept
• SAP does not use the database’s lock concept
• Deadlock:
– May occur when two programs wait for each other to lock data
set
– Rare
ABAP Course André Bögelsack, Valentin Nicolescu 5
6. Locking concept
Modes:
1. Read lock = shared lock
• Locks data set for reading
• Several shared locks may exist on one data set at the same
time
• Prevents the SAP system from creating an exclusive lock on a
data set
2. Write lock = exclusive lock
• Locks data set for writing/changing
• No shared locks, only one is allowed at the same time
• First come, first serve
ABAP Course André Bögelsack, Valentin Nicolescu 6
7. Locking concept
Creation of a lock object:
• Creation can be done in data
dictionary (SE11)
• One lock object per database
table
• Lock objects are generated
automatically by using the
primary key
• There is only one lock object
dealing with all lock modes
ABAP Course André Bögelsack, Valentin Nicolescu 7
8. Usage of lock objects
• Two function modules are generated automatically when creating
a lock object:
– Enqueue_<lock object> lock data set
– Dequeue_<lock object> unlock data set
• Before writing/reading data set lock data set
• After writing/reading data set unlock data set
• In case of an error unlock data set
• Use button ‘PATTERN’ to avoid misspellings
• Locks can be viewed and deleted in transaction SM12
ABAP Course André Bögelsack, Valentin Nicolescu 8
9. Generation of lock objects
Lock object
EZ_SPFLI
Activate
Function Function
ENQUEUE_ESFLIGHT DEQUEUE_ESFLIGHT
Lock data set Unlock data set
ABAP Course André Bögelsack, Valentin Nicolescu 9
10. ENQUEUE parameter‘s
Parameter Value Meaning
mode_<tabname> ‘S‘ Read lock (shared)
‘X‘ Exclusive lock (not shared)
<lock parameter> <value> Field values used to lock the data set
_wait SPACE If foreign lock, no new attempt
‘X‘ If foreign lock, new attempt
_collect SPACE Lock without local lock container
‘X’ Lock with local lock container
ABAP Course André Bögelsack, Valentin Nicolescu 10
11. Logical unit of work (LUW)
Logical unit of work (transaction)
breakdown
Process before
Process after
output (PBO)
input (PAI) 100 Commit
100
Dynpro
100
User input
Process before
Process after
output (PBO)
input (PAI) 200
200
Dynpro
Scenario: 200
What happens if a breakdown of the
SAP system occurs in the middle of the User input
transaction? What happens to the data?
ABAP Course André Bögelsack, Valentin Nicolescu 11
12. Logical unit of work (LUW)
• Problem:
– New data sets are transferred into the database by each screen
– Only if last screen of the program is reached and all data sets
are written to the database the data are correct
• Solution
– Updates to database are written to the updater process
– Only when last screen of the program is reached, the updater
receives a trigger to write data to database (commit) or to
dismiss (rollback)
ensures data integrity
ABAP Course André Bögelsack, Valentin Nicolescu 12
13. Logical unit of work (LUW)
• Schema: Protocoll table
Data
Data
Data
Data Data
deletes
1 3
Work process Work process
2 5
Program Updater
4
Lock data set
Database
ABAP Course André Bögelsack, Valentin Nicolescu 13