Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Dec-2008
Objectives
The participants will be able to:
Retrieve information from the database using Open SQL.
Create basic Select statements for use in ABAP Code.
Describe the system field SY-SUBRC and properly use it in an ABAP Program.
Dec-2008
Jo
h
Sm n
ith
ry
Ma es
l
Sti
Data
DB
Dec-2008
Open SQL
Dec-2008
John Smith
Work Area
DB
Dec-2008
KNA1
INTO WA_KNA1.
WRITE: / WA_KNA1-KUNNR, WA_KNA1NAME1.
ENDSELECT.
Dec-2008
KNA1
INTO WA_KNA1
WHERE KTOKD = 0001.
WRITE: / WA_KNA1-KUNNR, WA_KNA1-NAME1.
ENDSELECT.
Dec-2008
SY-SUBRC
Dec-2008
Dec-2008
INTO CORRESPONDING-FIELDS
DATA: WA_KNA1.
SELECT KUNNR
NAME1
FROM KNA1
INTO CORRESPONDING-FIELDS
OF WA_KNA1.
WRITE : / WA_KNA1-KUNNR, WA_KNA1-NAME1.
ENDSELECT.
IF SY-SUBRC <> 0.
WRITE: / No records found..
ENDIF.
10
Dec-2008
Demonstration
Selection of data from a database table, checking sy-subrc and displaying the
values in a report.
11
Dec-2008
Practice
Selection of data from a database table, checking sy-subrc and displaying the
values in a report.
12
Dec-2008
Summary
SQL has three main components:
Data Manipulation Language (DML):
Data Definition Language (DDL):
Data Control Language (DCL):
13
Dec-2008
Questions
What is SQL ? And What are different types of SQL ?
How values can be retrieved from a database table ?
Why SY-SUBRC check is required in the program ?
14
Dec-2008