Professional Documents
Culture Documents
TO SAP ABAP
PETER M OXON
PUBLISHED BY:
SAPPROUK Limited
http://www.saptraininghq.com
Copyright, Legal Notice and Disclaimer:
All rights reserved.
No part of this publication may be copied, reproduced in any format, by any means,
electronic or otherwise, without prior consent from the copyright owner and
publisher of this book.
This publication is protected under the US Copyright Act of 1976 and all other
applicable international, federal, state and local laws, and all rights are reserved,
including resale rights: you are not allowed to give or sell this Guide to anyone else.
If you received this publication from anyone other than saptraininghq.com, you've
received a pirated copy. Please contact us via e-mail at support at saptraininghq.com
and notify us of the situation.
Although the author and publisher have made every reasonable attempt to achieve
complete accuracy of the content in this Guide, they assume no responsibility for
errors or omissions. Also, you should use this information as you see fit, and at your
own risk. Your particular situation may not be exactly suited to the examples
illustrated here; in fact, it's likely that they won't be the same, and you should adjust
your use of the information and recommendations accordingly.
This book is not affiliated with, sponsored by, or approved by SAP AG. Any
trademarks, service marks, product names or named features are assumed to be the
property of their respective owners, and are used only for reference. There is no
implied endorsement if we use one of these terms.
____________________________________________
Contact the Author 12
Introduction 13
How to Use This Book 14
Chapter 1: SAP System Overview 15
SAP System Architecture 15
Environment for Programs 18
Technical Settings 45
Entering Records into a Table 48
iv
Viewing the Data in a Table 51
Chapter 3 55
Creating a Program 55
Code Editor 57
Write Statements 62
String Manipulation 87
Concatenate 87
v
Condense 88
Shift 93
Split 94
SubFields 96
Chapter 6 Debugging Programs 98
Fields mode 102
System Variables 103
Table Mode 103
Breakpoints 105
Static Breakpoints 107
Watchpoints 108
Ending a Debug Session 111
Chapter 7: Working with Database Tables 113
Making a Copy of a Table 113
Add New Fields 116
Foreign Keys 117
Append Structures 122
Include Structures 124
vi
Key Fields 127
Deleting Fields 130
Deleting Tables 133
Chapter 8 Working with Other Data Types 136
Date and Time Fields 136
Date Fields in Calculations 138
Time Fields in Calculations 141
Quantity and Currency Fields in Calculations 142
Chapter 9 Modifying Data in a Database Table 146
Authorisations 146
Fundamentals 146
Database Lock Objects 148
Using Open SQL Statements 149
Using Open SQL Statements 5 Statements 150
Insert Statement 151
Clear Statement 155
Update Statement 157
Modify Statement 158
Delete Statement 160
Chapter 10 Program Flow Control and Logical Expressions 164
Control Structures 164
If Statement 164
Linking Logical Expressions Together 169
Nested If Statements 169
Case Statement 170
Select Loops 171
vii
Do Loops 172
Nested Do Loops 175
While Loops 178
Nested While Loops 179
Loop Termination CONTINUE 180
Loop Termination CHECK 181
Loop Termination EXIT 182
Chapter 11 Selection Screens 184
Events 184
Intro to Selection Screens 185
Creating Selection Screens 186
At Selection Screen 187
Parameters 188
viii
Comments 218
Format a Line and Position 219
Element Blocks 221
Chapter 12 Internal Tables 223
Introduction 223
Types of Internal Tables 224
ix
Delete a Table with a Header Line 243
x
xi
As the reader of this book you are my most important critic and commentator. I
would love to hear from you to let me know what you did and did not like about this
book, as well as to what you think I could do in future books to make them stronger.
E-mail: pete@sappro.co.uk
Please note that although I cannot personally help you learn SAP ABAP, I am
available for corporate hire for project management, technical lead and mentoring
programs.
12
INTRODUCTION
13
INTRODUCTION
14
SAP SYSTEM OVERVIEW
15
SAP SYSTEM OVERVIEW
16
SAP SYSTEM OVERVIEW
17
SAP SYSTEM OVERVIEW
18
SAP SYSTEM OVERVIEW
19
SAP SYSTEM OVERVIEW
20
SAP SYSTEM OVERVIEW
21
SAP SYSTEM OVERVIEW
22
SAP SYSTEM OVERVIEW
23
SAP SYSTEM OVERVIEW
24
SAP SYSTEM OVERVIEW
25
SAP SYSTEM OVERVIEW
26
SAP SYSTEM OVERVIEW
27
SAP SYSTEM OVERVIEW
28