15
Horst Keller The Official ABAP" Reference Volume II Galileo Press Bonn Boston

TheOfficial ABAP Reference - · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Embed Size (px)

Citation preview

Page 1: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Horst Keller

The Official ABAP" Reference

Volume II

Galileo Press

Bonn • Boston

Page 2: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

PART 10 User Dialogs

33.1 SAP GUI 832

33.2 Dynpro Fields 833

33.3 Dynpro Flow and Dynpro Sequences 834

33.4 Statements in the Dynpro Flow Logic 835

33.4.1 Event Blocks of the Dynpro Flow Logic 836

33.4.2 Calling Dialog Modules 838

33.4.3 Controlling Data Transfer and Flow Logic 842

33.4.4 Processing Chains 848

33.4.5 Table Controls 849

33.4.6 Subscreens, Tabstrip, and Splitter Controls 853

33.5 ABAP Statements for Dynpros 859

33.5.1 Calling a Dynpro Sequence 859

33.5.2 Setting the GUI Status 860

33.5.3 Determining the GUI Status 862

33.5.4 Setting the GUI Title 863

33.5.5 Suppressing the Display 865

33.5.6 Reading Attributes of Screen Elements 866

33.5.7 Modifying Attributes of Screen Elements 868

33.5.8 Setting the Cursor 870

33.5.9 Evaluating the Cursor Position 872

33.5.10 Declaring Controls 873

33.5.11 Initializing Table Control 879

33.5.12 Exiting Step-Loop Processing 879

33.5.13 Holding Input Data 880

33.5.14 Setting the Next Dynpro 881

33.5.15 Leaving a Dynpro 881

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^K^^^^^^^^^^t^^wlfcM^^S^MMIiMi^SM^aiS^^^^^^^^^^^^^H^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^M

34.1 Creating Selection Screens 884

34.1.1 Creating Selection Screens 884

34.1.2 Laying Out Selection Screens 888

815

Page 3: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

34.1.3 Adopting Elements of Other Selection Screens 905

34.2 Defining Parameters 909

34.2.1 Data Type of the Parameter 911

34.2.2 Attributes of Screen Elements 914

34.2.3 Attributes of the Value and Passing of Values 918

34.3 Defining Selection Criteria 922

34.3.1 Data Type of the low and high Columns 926

34.3.2 Attributes of Screen Elements 928

34.3.3 Attributes of the Value and Passing of Values 930

34.3.4 Addition for Selection Screens of Logical Databases 932

34.4 Calling Selection Screens 933

34.4.1 Call via SUBMIT 933

34.4.2 Call via Report Transaction 933

34.4.3 Call via Dialog Transaction 934

34.4.4 Call in the Program 934

34.5 Selection-Screen Processing 935

34.6 Selection Screen Events 936

34.6.1 PBO 937

34.6.2 Passing Individual Data 938

34.6.3 Passing a Multiple Selection 938

34.6.4 Block Transfer 938

34.6.5 Passing the Data of a Radio Button Group 939

34.6.6 Overall Transfer 939

34.6.7 POH and POV 939

34.6.8 Exit Command 940

34.7 Free Selections 941

34.7.1 Free Selections in Logical Databases 941

34.7.2 Free Selections in Any Programs 942

35.1 Properties of Classic Lists 945

35.1.1 Lists in ABAP Programs 945

35.1.2 Basic List 945

35.1.3 Details Lists 946

35.1.4 Structure of a List 946

35.1.5 Print Lists 947

35.1.6 Lists and ABAP Objects 947

816

Page 4: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

35.2 Creating Lists 948

35.2.1 Writing Lists 948

35.2.2 Output Length in Lists 954

35.2.3 Processing the Output 958

35.2.4 Formatting the Output 959

35.2.5 Automatic Line Elements 960

35.2.6 List Elements 960

35.2.7 Creating Blank Lines 965

35.2.8 Creating Horizontal Lines 965

35.2.9 Formatting List Sections 966

35.2.10 Controlling Blank Lines 973

35.2.11 Positioning the List Cursor Vertically 974

35.2.12 Positioning the List Cursor Horizontally 978

35.2.13 Fixed Area When Scrolling Horizontally 979

35.2.14 Page Breaks and Print Lists 980

35.2.15 Conditional Page Break 988

35.2.16 Storing Variables in the List Level 989

35.3 Processing Lists in the List Buffer 990

35.3.1 Reading List Lines 990

35.3.2 Modifying List Lines 993

35.3.3 Scrolling Lists 995

35.3.4 Reading List Attributes 998

35.4 Displaying Lists 1001

35.4.1 Calling Basic Lists 1002

35.4.2 Leaving the List Display 1003

35.4.3 Displaying a List in the Dialog Window 1004

35.4.4 GUI Status of a Screen List 1005

35.4.5 Title of a Screen List 1007

35.4.6 Positioning the Cursor on the List 1007

35.4.7 Evaluating the List at the Cursor Position 1010

35.5 Printing Lists 1012

35.5.1 Switching Printing On and Off 1012

35.5.2 Print List Levels and Spool Requests 1013

35.5.3 Print Parameters 1015

35.5.4 Print Control 1021

35.5.5 Printing Screen Lists 1025

35.6 Event Blocks for List Events 1026

35.6.1 Events during List Creation 1026

817

Page 5: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

35.6.2 Events after User Actions in Displayed Lists 1028

35.6.3 Triggering List Events from the Program 1031

36.1 Storing Messages 1033

36.2 Behavior of Messages 1034

36.2.1 Messages in List Processing 1034

36.2.2 Messages in Dialog Processing 1035

36.2.3 Messages in Control Processing 1039

36.2.4 Messages in Batch Input 1039

36.2.5 Messages in Background Processing 1040

36.2.6 Messages during Updates 1040

36.2.7 Messages in Conversion Routines 1041

36.2.8 Messages in Procedures 1041

36.2.9 Messages in RFC Processing 1042

36.2.10 Messages in HTTP Servers 1042

36.3 Sending Messages 1042

36.3.1 Specifying a Message 1043

36.3.2 Specifying a Character String 1048

36.3.3 Message Options 1049

PART 11 Processing External Data

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^337.1 Database Tables 1055

37.1.1 Relational Databases 1055

37.1.2 Indexes of Database Tables 1056

37.2 Open SQL 1056

37.2.1 Environment of Open SQL 1056

37.2.2 Read Accesses 1063

37.2.3 Write Accesses 1118

37.2.4 Work Areas for Open SQL 1139

37.2.5 Streaming and Locators for Open SQL 1141

37.2.6 Treatable Exceptions 1145

37.3 Object Services 1145

37.3.1 Persistence Service 1145

818

Page 6: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

37.3.2 Transaction Service 1148

37.3.3 Query Service 1149

37.4 Native SQL 1151

37.4.1 Integrating Native SQL 1151

37.4.2 Host Variables 1153

37.4.3 Cursor Processing 1154

37.4.4 Calling Stored Procedures 1156

37.4.5 Defining a Database Connection 1158

37.4.6 Treatable Exceptions 1162

37.5 ADBC 1162

37.5.1 Executing SQL Statements 1162

37.5.2 Preparing SQL Statements 1167

37.5.3 Database Connections 1168

37.5.4 Exception Class for ADBC 1170

38.1 Creating Data Clusters 1171

38.1.1 Defining Data Clusters 1172

38.1.2 Specifying the Memory Medium 1173

38.1.3 Treatable Exceptions 1178

38.1.4 INDX-Like Database Tables 1178

38.1.5 SQL Access to Data Clusters 1180

38.2 Reading Data Clusters 1181

38.2.1 Specifying the Source 1181

38.2.2 Specifying the Memory Medium 1183

38.2.3 Conversion Additions 1186

38.2.4 Text Language Rule 1193

38.2.5 Treatable Exceptions 1194

38.3 Importing the Directory 1194

38.4 Deleting Data Clusters 1196

38.5 Deleting Data Clusters in the ABAP Memory 1198

38.6 System Classes for Data Clusters 1198

39.1 Properties of the File Interface 1199

39.1.1 Addressing Files 1199

39.1.2 Authorizations for Accessing Files 1200

819

Page 7: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

39.1.3 Locks 1202

39.1.4 File Interface and Unicode 1202

39.2 Opening a File 120339.2.1 Specifying the Access Type 1204

39.2.2 Specifying the Storage Type 1205

39.2.3 Specifying the Position 121339.2.4 Operating System-Dependent Additions 1214

39.2.5 Error Handling 121639.2.6 Treatable Exceptions 1218

39.3 Writing a File1219

39.3.1 Specifying Lengths 122039.3.2 Defining the Line End Marker 122139.3.3 Treatable Exceptions 1222

39.4 Reading a File 122239.4.1 Specifying the Maximum Length 122539.4.2 Determining the Length Read 1226

39.4.3 Treatable Exceptions 122639.5 Determining File Attributes 1227

39.5.1 Determining the Position 1227

39.5.2 Determining Attributes 122839.5.3 Treatable Exceptions 1230

39.6 Changing File Attributes 123139.6.1 Specifying the Position 1231

39.6.2 Changing Attributes 123339.6.3 Treatable Exceptions 1235

39.7 Changing the File Size 123539.8 Closing a File

123739.9 Deleting a File

1238

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^40.1 Database LUW

123940.1.1 Database Commit 124040.1.2 Database Rollback 124140.1.3 Database Commits/Rollbacks for a Database

Connection1242

40.2 SAP LUW1243

40.2.1 Registering Update Function Modules 1244

820

Page 8: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

40.2.2 Registering Subroutines 1246

40.2.3 Executing an SAP Commit 1247

40.2.4 Executing an SAP Rollback 1250

40.2.5 Activating a Local Update 1251

40.3 Database Locks 1252

40.3.1 Setting Database Locks 1252

40.3.2 Types of Database Locks 1252

40.3.3 Isolation Level 1253

40.3.4 Deadlock 1253

40.3.5 Releasing Database Locks 1254

40.4 SAP Locks 1254

40.4.1 Setting and Checking SAP Locks 1254

40.4.2 Releasing SAP Locks 1255

40.5 Authorizations 1256

PART 12 Program Parameters

WmK^^^^^^^^^^^^^^^^^sS^k^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^SSm

41.1 SPA/GPA Parameters 1261

41.1.1 SPA/GPA Parameters and ABAP Programs 1261

41.1.2 Administrating SPA/GPA Parameters 1262

41.1.3 SPA/GPA Parameters and Dynpro Fields 1263

41.2 Setting SPA/GPA Parameters 1263

41.3 Reading SPA/GPA Parameters 1265

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

42.1 Text Pools 1267

42.2 Text Environment 1269

42.2.1 Text Environment in Unicode Systems 1270

42.2.2 Text Environment in non-Unicode Systems 1270

42.2.3 Setting the Text Environment 1271

42.2.4 Determining the Text Environment 1275

42.3 Formatting Settings 1275

42.3.1 Country-Specific Formats 1276

42.3.2 Setting Formatting Settings 1279

821

Page 9: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

43.1 System Fields for Date and Time 1281

43.2 Time Stamps 1283

43.2.1 Properties of Time Stamps 1283

43.2.2 Creating Current Time Stamp 1286

43.2.3 Converting Time Stamp Into Local Time 1287

43.2.4 Converting Local Time Into a Time Stamp 1289

PART 13 Program Processing

44.1 Checkpoints 1295

44.1.1 Assertions 1295

44.1.2 Breakpoints 1299

44.1.3 Logpoints 1302

44.2 Runtime Measurement 1302

44.2.1 Relative Program Runtime 1302

44.2.2 Setting the Time Resolution 1304

44.2.3 Class for Runtime Measurements 1305

44.3 Runtime Analysis 1305

45.1 Source Code 1307

45.1.1 Dynamic Subroutine Pool 1307

45.1.2 Reading a Program 1313

45.1.3 Syntax Check 1315

45.1.4 Creating or Overwriting a Program 1319

45.1.5 Calling the ABAP Editor 1323

45.2 Text Elements 1324

45.2.1 Reading a Text Pool 1324

45.2.2 Creating or Overwriting a Text Pool 1326

822

Page 10: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

PART 14 Data and Communication interfaces

kS^S^^^^^i^^^^^^S^^^^^^^^^^^s^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^s^^^s

46.1 Properties of an RFC 1331

46.1.1 RFC Interface 1332

46.1.2 RFC Language Elements 1332

46.1.3 RFC Destination 1333

46.1.4 RFC Context 1334

46.1.5 RFC Protocol 1334

46.1.6 RFC Exceptions 1335

46.1.7 RFC System Fields 1337

46.1.8 RFC Authorizations 1337

46.1.9 RFC Trust Relationships 1337

46.1.10 RFC Dialog Interactions 1338

46.1.11 RFC Restrictions 1339

46.2 Remote Function Call 1340

46.2.1 Synchronous Remote Function Call 1340

46.2.2 Asynchronous Remote Function Call 1346

46.2.3 Background RFC 1353

46.2.4 Transactional Remote Function Call 1355

47.1 XSL Transformations 1357

47.2 Simple Transformations 1358

47.3 Canonical XML Representation 1359

47.3.1 General Format 1359

47.3.2 Mapping ABAP Data Types 1361

47.4 Calling a Transformation 1380

47.4.1 Transformation Source 1381

47.4.2 Transformation Result 1382

47.4.3 Transformation Parameters 1384

47.4.4 Transformation Options 1386

47.4.5 Treatable Exceptions 1390

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^a48.1 Creating an Automation Object 1393

48.2 Calling an Automation Method 1395

823

Page 11: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

48.3 Determining the Attributes of an Automation Object 1398

48.4 Changing the Attributes of an Automation Object 1399

48.5 Releasing an Automation Object 1400

PART 15 Enhancements

E^^^^^^^^^^^^^H^^^^^^^K- '

.>"«• < 'v • '• '-i'-fc.'-. ->;;vr.-.-itxj.-'-.- ''JmUhI

49.1 Implicit Enhancement Options 1403

49.2 Explicit Enhancement Options 1404

49.2.1 Enhancement Option for Point 1404

49.2.2 Enhancement Option for Section 1406

49.2.3 Enhancement Implementation 1409

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^s50.1 Creating a BAdI Object 1412

50.1.1 Specifying Filter Values 1414

50.1.2 Specifying the Context 1415

50.1.3 Treatable Exceptions 1416

50.2 Calling BAdl Methods 1416

PART 16 Obsolete Statements

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^H51.1 Obsolete Statement Structures 1421

51.2 Obsolete Pseudo Comments 1421

51.2.1 Pseudo Comments for the Extended Program Check 1421

51.2.2 Pseudo Comments for Test Classes 1422

51.3 Obsolete Deactivation of the Program Check 1423

i»Mti imiiT3nii'i rnFnrBri i jmi, . imBs!

52.1 Obsolete Subroutines 1425

52.1.1 Creating a Subroutine 1425

52.1.2 Defining a Subroutine in Parts 1431

52.2 Obsolete Function Module Parameters 1432

52.2.1 Declaring Table Parameters 1432

824

Page 12: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

52.2.2 Obsolete Typing 1433

52.2.3 Global Parameters 1434

52.3 Obsolete Temporary Storage 1435

pjtBpq^^^^^na53.1 Obsolete Type Definitions 1437

53.1.1 Implicit Type Specifications 1437

53.1.2 Unnecessary Length Specifications 1437

53.1.3 Anonymous Components 1438

53.2 Obsolete Declaration and Loading 1438

53.2.1 Loading a Type Group 1438

53.2.2 Loading a Class or Interface 1439

53.2.3 Declaring a Data Object 1440

53.3 Obsolete Interface Work Areas 1440

53.3.1 Common Data Area 1441

53.3.2 Additional Table Work Area 1443

53.4 Obsolete Internal Tables 1443

53.4.1 Internal Tables with Header Line 1443

53.4.2 Obsolete Declaration of Any Line Types 1446

53.4.3 Explicit Declaration of a Header Line 1447

53.4.4 Obsolete Declaration of Structured Line Types 1447

53.4.5 Obsolete Declaration of Ranges Tables 1448

53.5 Obsolete Field Symbols 1449

53.5.1 Obsolete Typing 1449

53.5.2 Obsolete Casting 1449

53.6 Obsolete Type Reference 1451

55.1 Obsolete Dialog Modules 1457

55.1.1 Suppressing the initial Screen 1458

55.1.2 Batch Input Session 1458

55.1.3 Parameter Passing 1459

55.2 Obsolete Function Module Exit 1459

55.3 Obsolete Function Module Exception 1461

55.4 Obsolete External Subroutine Call 1462

825

Page 13: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

55.5 Obsolete Exiting 1462

55.5.1 Obsolete Exiting of Called Programs 1462

55.5.2 Obsolete Exiting of Any Processing Blocks 1463

^^^^M^^3B^S^^3^^^^8m^^^^^^lM''" :- •- i . i XmmJI

56.1 Obsolete Logical Expressions 1465

56.1.1 Obsolete Relational Operators 1465

56.1.2 Obsolete Short Form for Selection Table 1465

56.1.3 Obsolete Check of Output Parameters 1466

56.2 Obsolete Control Structures 1467

56.2.1 Obsolete Statements in Case Distinctions 1467

56.2.2 Obsolete Branching 1467

56.2.3 Obsolete Unconditional Loop Processing 1469

56.2.4 Obsolete Conditional Loop Processing 1472

56.3 Obsolete Exception Handling 1472

^^^^^^^^^^^^^^S Bill57.1 Obsolete Percentaged Subfield 1475

57.2 Obsolete Conversion 1475

57.3 Obsolete Casting 1476

57.4 Obsolete Dynamic Memory Area 1477

57.5 Obsolete Initialization 1478

^^^^^^^^^^^^^^^^^^^^^ffi--.;.. _.^^^^^^^^^^^^^358.1 Obsolete Addition of Field Sequences 1479

58.2 Calculating Component by Component 1481

^^^^^^^S^^^^S^^^^^^^H^^^^^^EJ^^^^H^^^^^^^^^^S si

59.1 Obsolete Search 1483

59.2 Obsolete Replacement 1486

59.3 Obsolete Translation 1487

59.3.1 Code Page and Number Format 1487

59.3.2 Forming Complement on Nine of a Date 1489

826

Page 14: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

^^^H^^3^^^^^^^^^^^^^SM^^^^^^^^^3i^^^^^^^^^^^^^^^^^^^^^^^^^^B

60.1 Obsolete Short Forms 1491

60.2 Obsolete Key Specifications 1491

60.2.1 No Specification 1492

60.2.2 Specifying a Subfield of a Line 1493

60.2.3 Specifying the Entire Line 1494

60.3 Obsolete Search 1495

60.4 Obsolete Assignment of Formatted Character Strings 1496

60.5 Obsolete Short Form of a Special Statement 1498

60.6 Obsolete Deletion 1500

I*J K*l^rVin 1^jfl^Wnr:- • -• -"A--MJH

61.1 Obsolete Dynpro Flow Logic 1501

61.1.1 Database Access 1501

61.1.2 Checking Values in the Flow Logic 1501

61.1.3 Obsolete Subscreen Enhancement 1504

61.1.4 Obsolete Step Loop Processing 1504

61.2 Obsolete List Processing 1510

61.2.1 Obsolete Formatting 1510

61.2.2 Obsolete Calculations 1511

61.2.3 Obsolete List Event 1514

61.2.4 Obsolete Printing 1514

61.3 Obsolete Text Editor 1515

62.1 Obsolete Database Accesses 1517

62.1.1 Obsolete Short Forms in Open SQL 1517

62.1.2 Obsolete Cursor Processing in Native SQL 1518

62.1.3 Obsolete Access Statements 1519

62.2 Obsolete Data Cluster Accesses 1524

62.2.1 Obsolete Short Forms 1524

62.2.2 Obsolete Implicit ID 1525

62.2.3 Obsolete Implicit Work Area 1526

62.2.4 Obsolete ID 1527

62.3 Obsolete Contexts 1527

62.3.1 Buffering of Contexts 1528

62.3.2 Creating Instances of Contexts 1529

827

Page 15: TheOfficial ABAP Reference -  · PDF fileHorst Keller TheOfficial ABAP"Reference Volume II GalileoPress Bonn • Boston

Contents

62.3.3 Providing Contexts with Key Values 1530

62.3.4 Querying Contexts 1530

62.4 Obsolete Logical Databases 1532

62.4.1 Interface Work Areas for Logical Databases 1533

62.4.2 Statements in Logical Databases 1533

62.4.3 Statements for Logical Databases 1542

62.4.4 Function Module for Logical Databases 1543

63.1 Obsolete XML Handling 1545

63.2 Obsolete CPI-C Interface 1545

63.3 Obsolete JavaScript Processing 1546

A ABAP Memory Organization 1549

A.1 General Memory Organization 1549

A.1.1 Application Server 1549

A.1.2 User Session 1549

A.1.3 Main Session 1550

A.1.4 Internal Session 1550

A.2 Programs in the Internal Session 1551

A.2.1 Program Groups 1551

A.2.2 Data Objects 1552

A.2.3 Instances of Classes 1553

A.2.4 Interface Work Areas 1553

A.2.5 Dynpros, Lists, and GUI Status 1553

B Memory Management of Deep Data Objects 1555

B.1 Memory Requirement of Deep Data Objects 1556

B.2 Maximum Size of Dynamic Data Objects 1557

B.3 Sharing between Dynamic Data Objects 1558

C ABAP Glossary 1561

Index 1645

828